1.

Solve : bat file help?

Answer»

Hi guys need some help over in this problem. I want to execute a series of commands as follows

Basically i need to execute these 3 commands from the command prompt.
1)console.exe>answer.txt (execute this command and OUTPUT to answer.txt)
2)are you a computer (string used to ask a question for the chat bot to REPLY)
3) /exit (exit the program)
when I do these 3 commands from the command prompt, It works out and the output(answers.txt) contains my answer.

But when I write these 3 commands to a bat file as follows

console.exe>answer.txt
are you a computer
/exit
exit

It only executes the 1st part of the bat file which is

console.exe>answer.txt

Just want to ask where have I gone wrong in the bat file scripting?
Any feedback is welcomed thanks.can you explain what console.exe does? , in a batch file writing are you a computer would be a error, you need to echo the WORDS in.. unless console.exe waits for input and thats the purpose of the /exit command?Console.exe is an executable which chats with you when u ask it a question. Thus the are you a computer is the question part.You must follow set batch file language, line for line, and
the second line is NOT a batch file command,
neither is line three.

You really need to study batch file command structure.
There are many good tutorials on the INTERNET, on how to write batch files.

Cheers mate!



Discussion

No Comment Found