simple execute and copy file issue

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ruggb
Posts: 1
Joined: 14 Aug 2010 14:06

simple execute and copy file issue

#1 Post by ruggb » 14 Aug 2010 14:26

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: simple execute and copy file issue

#2 Post by aGerman » 14 Aug 2010 14:36

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

Post Reply