Reputation:
I am using a bat file on a Windows 2000 SP4 server to copy database files while the database is shut down. Once the bat file hits the xcopy command, it does the copy, but never returns to the bat file to continue with the other commands (start up the database, etc). I should mention that the xcopy takes several hours. Is there some sort of time out or time max with bat files? Is this normal? If so, is there any way around this?
Upvotes: 2
Views: 4514
Reputation: 7426
Presumably everything looks OK in your backup.log file? It looks like you are redirecting STDOUT to your log file, but not STDERR - would suggest adding 2>&1 to the end of the command line to ensure you're not missing any error information from the log.
Upvotes: 1
Reputation: 103515
Also, make sure that you are running the XCOPY.EXE app, and not finding an XCOPY.BAT file somewhere on your path. (calling a batch file from a batch file prevent returning, unless you use the CALL command)
And, be sure you are not overwriting the batch file itself during the XCOPY.
Upvotes: 2
Reputation: 58685
Batch files don't timeout. It sounds like you might be running into a prompt from XCOPY, like an "Are you sure" prompt.
Make sure you've added the necessary command-line switches to XCOPY to make it silent.
The ones I'm aware of are:
-Y to suppress prompts about overwriting files
-C continue even if errors occur
Upvotes: 3
Reputation: 21369
There's no timeout that I'm aware of on .bat or .cmd files. However, there may be on the process that's launching it? How are you launching it?
Upvotes: 0