Page 1 of 1

simple execute and copy file issue

Posted: 14 Aug 2010 14:26
by ruggb
I created a simple bat file to start a program then copy files created in that program to a backup location when the program is closed. It works fine for 2 other programs, but for this one it is falling thru and copying the files as the program is opening.

outline of bat
============
program.exe
xcopy source to destination
====================

All the bat files are basically the same.
Process Explorer does in fact show the program opening then closing and xcopy running.
the program window remains on the screen for use.

Is there any way to make the bat file wait until the program window is closed before copying the files and closing???????

thx

Re: simple execute and copy file issue

Posted: 14 Aug 2010 14:36
by aGerman
Normally your batch should wait if you run the program like you wrote.

There are two further ways you could try.
call program.exe
and
start "" /wait "program.exe"

Regards
aGerman