BatchFile Assistance: Close Window

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

BatchFile Assistance: Close Window

Post by jstevens »

I can run multiple batch files with the code below but enounter a challenge where each batch file's window called will not close.

Code: Select all

set source=D:\BatchFiles\

for %%b in ("Run01.bat" "Run02.bat" "Run03.bat") do start call %source%%%b|| exit /b 1
Your assistance is appreciated,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78574
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: BatchFile Assistance: Close Window

Post by HansV »

I'm not familiar with batch files, and I'm sure John Gray will come up with a better suggestion, but perhaps

for %%b in ("Run01.bat" "Run02.bat" "Run03.bat") do start cmd /c %source%%%b
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: BatchFile Assistance: Close Window

Post by jstevens »

Hans,

Your suggestion worked. I tried putting the switch here: "/b cmd /c 1" prior to posting but came up empty.

Thank you very much,
John
Regards,
John

User avatar
John Gray
PlatinumLounger
Posts: 5414
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: BatchFile Assistance: Close Window

Post by John Gray »

The only change I'd suggest is to put a null title after START, as in START "" CMD /C ...

Start can be a bit picky at times...
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...