Solved Making a faster batch file

February 9, 2014 at 04:33:51
Specs: Windows 7, 8GB
Before I invest hours in this,I'm making a program in batch that, when asked questions, will answer them. I would like to know, which would be a faster, and a better method:
1) Having all the questions and answers stored in the single batch file (There are LOTS and LOTS of them)
Example of the question format:
if /I "%str%"=="HOW ARE YOU" (
set input=I am well, how are you?
goto num
where str is what the user inputs and it gets converted earlier in the code to all capitals and deletes punctuation and num is a part of the file that all questions jump to because that's where the answer is displayed in the console and that's how it speaks

2) Turn the batch file into more of a search engine and have a database of files and text files on the same hard drive the batch file is on (that's all that's on the hard drive) and then allow it to search the hard drive accordingly and only access the information it needs to
if /I "%str%"=="HOW ARE YOU" (
set input=1
goto num

Here, str is still what the user inputs, but instead of it having all the questions it would be narrowed down by instead checking for keywords as opposed to having a list of tens of thousands of lines of code in the file, but rather, forming a sort of, local search engine out of the hard drive

Which method is better and faster? and why?

See More: Making a faster batch file

Report •

February 9, 2014 at 06:35:08
Batch files were never designed for complex processing so they are never going to run very fast.

They are really only meant for very simple, but repetitive tasks.

you would be better of learning a programming language that is designed for complex processing.


message edited by StuartS

Report •

February 9, 2014 at 07:18:21
✔ Best Answer
Personally, I would use the second option in which you have a database of text files. The reason for this would be it would make adding and changing responses much easier. Rather than having to hunt through code for the section labeled 'HOW ARE YOU', you could just search the folder that contains the txt file HOW_ARE_YOU.txt, then easily modify the contents (which would essentially be 'I am well, how are you?')

But I completely agree with Stuart, this is waaay beyond Batch.

Report •

February 9, 2014 at 07:38:39
In case it helps those that are following the thread, Danm992 is extremely dedicated and through with the idea of programming it in batch. It would be well worth looking at the past posts, if you haven't and are interested.


Report •

Related Solutions

February 9, 2014 at 16:02:03
Well true, here's the thing, I tried using dev C++ and doing this in c++ but the compiler wouldn't compile it on windows 8.. then I got WxDevc++ or whatever it is called and it compiles but it is missing libraries so it doesn't work with my code though the other one does but not on my os..

Would vbs be ok do you guys think for what it is I am doing as mentioned above?

Report •

February 9, 2014 at 16:13:50
Based on my experience with vbs, I doubt it would really be easier to use VBS than Batch.

Report •

February 9, 2014 at 16:39:47
So what do you suggest?

Report •

February 9, 2014 at 16:46:38
I noticed you said you tried using C++. I haven't ever used Dev C++, but personally I use both Eclipse and Netbeans, both are great programs and work with C++. I am currently running Windows 8.1 and haven't had a problem with either of them, on this comp or any other.

Click here for Eclipse, on the right you'll see the download links for either Windows 32x or 64x.

Click here for NetBeans, just select either the full version or just the C++ version.

Both are completely free and open source IDEs.

One last thing, you'll need Java 7 (at least) to be able to run C++ on NetBeans:

Java Download

message edited by NT56erbx

Report •

February 9, 2014 at 17:22:05
I suggest C# and Visual Studio Express. VSS is probably one of the best IDE's, and while the free version isn't as great, I still like it over NetBeans.

How To Ask Questions The Smart Way

Report •

Ask Question