Link to home
Start Free TrialLog in
Avatar of Dancindan84
Dancindan84Flag for Canada

asked on

Batch file start command issue

I have a batch file that I'm trying to write that does multiple commands waiting for completion between them. I've found a way to do that using start /wait, but then the command prompt that start launches won't close until I type exit in it.

Here's the commands I need run:
e:
cd bea92\weblogic92\config\WebCTDomain\
start /wait backupRestoreCLI --action=restore --backupdir=f:\200909\ --configfile=F:\200909\restore_request_200909_1.xml --logfile=f:\200909\restore.log --username=admin --password=****** --glcid=URN:X-WEBCT-VISTA-V1:e4e1f328-c08b-ed0a-00ca-b7830a4dbddd
start /wait backupRestoreCLI --action=restore --backupdir=f:\200909\ --configfile=F:\200909\restore_request_200909_2.xml --logfile=f:\200909\restore.log --username=admin --password=****** --glcid=URN:X-WEBCT-VISTA-V1:e4e1f328-c08b-ed0a-00ca-b7830a4dbddd
start /wait backupRestoreCLI --action=restore --backupdir=f:\200909\ --configfile=F:\200909\restore_request_200909_3.xml --logfile=f:\200909\restore.log --username=admin --password=****** --glcid=URN:X-WEBCT-VISTA-V1:e4e1f328-c08b-ed0a-00ca-b7830a4dbddd
start /wait backupRestoreCLI --action=restore --backupdir=f:\200909\ --configfile=F:\200909\restore_request_200909_4.xml --logfile=f:\200909\restore.log --username=admin --password=****** --glcid=URN:X-WEBCT-VISTA-V1:e4e1f328-c08b-ed0a-00ca-b7830a4dbddd
start /wait backupRestoreCLI --action=restore --backupdir=f:\200909\ --configfile=F:\200909\restore_request_200909_5.xml --logfile=f:\200909\restore.log --username=admin --password=****** --glcid=URN:X-WEBCT-VISTA-V1:e4e1f328-c08b-ed0a-00ca-b7830a4dbddd

I tried adding a @ exit at the end of each line to try and get it to do that after the command had completed (as seen in the screenshot), but it doesn't seem to do anything. What you're seeing in the screenshot is the batch file running on top, and the start command running on the bottom. It just sits like that until I type exit into the start command window at which point the batch file moves to the next command. I tried running the start command with /B and it just did the exact same thing with only 1 window instead of two, and like I said I tried adding a @ exit as well that didn't work.

Any help would be greatly appreciated. Thanks.
screenshot2.jpg
Avatar of t0t0
t0t0
Flag of United Kingdom of Great Britain and Northern Ireland image

have you tried START /B /WAIT (with the '/B' option)?
Avatar of Dancindan84

ASKER

Yeap, I made note of that at the end of my comment (sorry, it was a bit of a novel). Does the same thing, but just in the single main window instead of in sub-windows. Just sits there after the command is complete until I type in exit then moves to the next command.
Here's a screenshot of that in action. It won't progress to the second command until I put in exit like you see here.
Screenshot replaced with scrubbed image by LadyModiva 042910 per http://www.experts-exchange.com/Community_Support/General/Q_26104402.html?cid=1572#a32346585

Open in new window

screenshot3.jpg
Ok, this is strange. I made a batch file with one of the commands in it and an exit (restore_1.cmd):

e:
cd bea92\weblogic92\config\WebCTDomain\
backupRestoreCLI --action=restore --backupdir=f:\200909\ --configfile=F:\200909\restore_request_200909_1.xml --logfile=f:\200909\restore.log --username=admin --password=****** --glcid=URN:X-WEBCT-VISTA-V1:e4e1f328-c08b-ed0a-00ca-b7830a4dbddd
exit

If I run that batch file it works exactly as expected (does the command and then exits). However, if I run that batch file by calling it from another batch file using the start command:

f:
cd 200909
start /wait restore_1.cmd

It hangs after completing and doesn't exit. Something about the start command is not working as expected.
Something strange was happening with the start /wait as if I changed the second file above to:

f:
cd 200909
call restore_1.cmd

it worked properly. As far as I'm aware, call is supposed to work the same as start /wait. I'm going to go back to my original file and see if using call instead of start /wait works as I want.
ASKER CERTIFIED SOLUTION
Avatar of Dancindan84
Dancindan84
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial