| 1. |
Solve : question prompts in batch file then continue batch? |
|
Answer» I am trying to make a command in a batch file to ask if you want to run a program and if you SAY Y then it will launch it BUT IF YOU SAY N it wont launch it and it will continue down to the next question. system ("\"%SystemRoot\\AUTO VIRUS REMOVAL\\kroot.exe"); // WHEN I RUN IT IT SAYS CANNOT FIND PATH SPECIFIED did you mean %SystemRoot% ? Also, I don't think the C run-time will expand the environment variable for you. Quote from: BC_Programmer on December 08, 2010, 12:51:59 AM Also, I don't think the C run-time will expand the environment variable for you. There is a function called getenv that will retrieve env vars Quote from: Salmon Trout on December 08, 2010, 10:17:08 AM There is a function called getenv that will retrieve env vars yes, but what I meant was the system() call would try to execute the name as provided, without expanding environment variables. Any time I see a system() call in C I shudder because oftentimes that means the program would have been better suited to be written in a scripting language. Quote from: BC_Programmer on December 08, 2010, 10:27:36 AM Any time I see a system() call in C I shudder because oftentimes that means the program would have been better suited to be written in a scripting language. This one certainly looks that way. |
|