PDA

View Full Version : Multiple program execution with Command prompt


stalker
September 15th, 2004, 02:33 PM
Hey all !!


Does anyone know, how to make make batch files to execute some "user" program (and not Windows cmd apps, like move, xcopy, etc.), and after that execute some other program, and optionally executing them on and on (one after another) ??


It is that, always when I try to lauch more than one application at the time (one after another), cmd prompt always "freezes" after first program execution, and waits till it's terminated (by user request of course), and only then go to the next line in that particular batch file.


help cmd also doesn't list any solution (at least obvious), at least I suppose /C and /K switches are not related to my problem, where /C description saying "Carries out the command specified by string and then terminates" , and /K description saying "Carries out the command specified by string but remains"


Here are two examples of what syntax I've tried. Note that "doze.exe" is just some cmd-line application, that puts "pause" (specified by integer) between lines/strings in batch files.



cd "D:\Nonsetup\Internet\Proxomitron"
call Proxomitron.exe
doze 12
cd "D:\Nonsetup\Internet\SoulSeek"
call slsk.exe




"D:\Nonsetup\Internet\Proxomitron\Proxomitron.exe"
doze 16
xcopy "D:\Nonsetup\Internet\SoulSeek\*.cfg" "F:\MySystem\=ConfigXP\Soulseek\LastConfig\" /Y /Q
doze 12
"D:\Nonsetup\Internet\SoulSeek\slsk.exe"




Thanks for any help, you can give.

nick s
September 15th, 2004, 02:58 PM
Take a look at "Using multiple commands and conditional processing symbols" here: Command shell overview (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx).

Nick

stalker
September 15th, 2004, 03:47 PM
Hey, thanks for reply.


I just got an e-mail from my friend (studying computing-related university), mentioning START command. It supposely execute various programs in batch files, but i execute them at the same time. Well, maybe I could add that doze.exe app (see previous post) to make pauses between.


Or I could simply create more batch files, each containg only one START line, and then call these batch files from some other (single) batch. This way, I would also "produce" a small delay between execution.



Nick, I think, I actually read that article once already.


But thanks anyway !!

GlobalForce
September 15th, 2004, 09:54 PM
Hey Stalker, long time notok ;D !

Just an active thought.....
Plug-in to google the type of switch you're looking for.

Example : I searched for articles on "explorer switches", this was the first in my results : http://www.onecomputerguy.com/app_info/explorer_switch.htm

Maybe your answer can be found this way.
Just a thought.....

GF

nick s
September 15th, 2004, 10:41 PM
I've been using nnCron (http://www.nncron.ru/) for automating/scheduling program startups. Runs as a service. nnCron LITE is the free version.

Nick

stalker
September 18th, 2004, 05:12 PM
Yes, doze.exe application is working.


And the best thing is that it actually doesn't require START command itself. Maybe because it's command-line app, and not GUI, but probably because it closes itself (after number of secs, specified in parameters), so batch job can continue.

In case if it would be some other command-line app doing some huge-job, one would also need to finish its work, and therefore wait for next application to run (yeah, or simply put START command also infront of it), like in GUI applications, where you run for example Firefox, p2p app, Outlook and close it after hours, so appearantly, batch job CAN'T continue.


Here is one example of how these batch now look like:


START /ABOVENORMAL D:\Nonsetup\Internet\Proxomitron\Proxomitron.exe
doze 16
START /BELOWNORMAL D:\Nonsetup\Internet\YahooPOPs\YahooPOPs.exe
doze 16
START /BELOWNORMAL D:\NonSetup\Auditing\Tcpview\Tcpview.exe
doze 16
START /BELOWNORMAL D:\Nonsetup\Resident\Firefox\firefox.exe -p default
doze 8
START D:\Nonsetup\Resident\Firefox\firefox.exe -p extra1
doze 16
xcopy D:\Nonsetup\Internet\SoulSeek\*.cfg F:\MySystem\=ConfigXP\Soulseek\LastConfig /Y /Q
doze 16
START D:\Nonsetup\Internet\SoulSeek\slsk.exe
beep 64 1




P.S., And yeah, I just like to keep batch files clean as possible.


_____________


Look at the parameters in attachment added. Beside many other features, this command offers pre-setting process's base-priority.

Note: The explanation of command continues, but I didn't want to post to huge attachment)