| 1. |
Solve : Running a program from BAT file make the dos window stuck and open? |
|
Answer» I am writing a batch file but I am stuck at a (hope) simple step; if I write into the batch file: The command line is not the way to start windows programs unless you wish to stay in the command line. That's not really TRUE. In fact it's not true at all. You are mistaking your lack of knowledge for a Windows limitation. Quote If you wish to start a Windows program from a script, you need to use another form of script other that batch. Maybe VBScript It's not "very awkward". At least that's my opinion. You just have to study the documentation of the START command. You can see this by opening a command window and typing START /? and hitting the ENTER key. You will probably want to use this command if you want to start Internet Explorer and immediately return to the batch file Code: [Select]start "" "C:\Program Files\Internet Explorer\iexplore.exe" Unless you need special options (namely, waiting for the program to FINISH) , you can just start them without using "start". control returns to the batch file immediately, as it would in the case of start. EDIT: nevermind that... start appears to work differently wether it's run within a batch or at the prompt itself.First of all make sure you are running it with Admin rights.... Quote @echo off The 'call' will wait until the program has finished/closed before executing the rest of the batch file. It is waiting for any parameters/changes first. The pause will leave it open until the user presses a key, so you can view your 'all done' message or any exceptions that occured. Rather than calling you can use 'start' to not wait and continue the batch file while it's running as well: Quote start iexplore.exe Now you can have fun writing your little virus...Quote Now you can have fun writing your little virus...Are you thinking the OP is a wanna be virus creator?It was just a joke, but one of the reasons you would want a batch file to continue running after executing something rather than waiting for the user. LOL anyways isn't IE a virus?Quote lol anyways isn't IE a virus? Maybe you mean that IE is the horse used by the Trojans.Quote from: Azzaboi on March 19, 2010, 01:40:39 PM It was just a joke, but one of the reasons you would want a batch file to continue running after executing something rather than waiting for the user. Yeah, like that time I totally separated my user interface thread from my worker threads in order to create a consistent and responsive User Interface, I was so totally using techniques used for making viruses. I am ashamed. |
|