I am migrating a very simple scheduled copy batch file from one server to another.
The copy batch file runs fine if you just click and run it manually. But when I schedule it using Windows Task Scheduler in Server 2003 it says it is running...but you cannot see what it is doing and nothing is copied over.
I have no idea as to why it does not work under the scheduler.
Ideas? Thoughts? Rude Comments?
DOS Question
Moderator: Moderators
- XMEN Iceman
- Moderator
- Posts: 2386
- Joined: Thu Nov 18, 1999 1:25 pm
- Spinning Hat
- Inmate
- Posts: 2564
- Joined: Wed Jun 07, 2000 10:06 am
- Location: Minneapolis, MN
- Contact:
- XMEN Gambit
- Site Admin
- Posts: 4122
- Joined: Thu Nov 18, 1999 12:00 am
First, does the batch file wait for input from the user? If so, it'll never get it! That would also explain the apparent hangup. Even if a command doesn't normally need input. For example, a copy might ask you if you're sure you want to overwrite an existing file, and then you're stuck. Most commands have a "silent" or "force" switch so you can power through that sort of thing.
Second, if you want to debug, you can send each command's output to a log file and check that. To do so, put one or two "greater than" signs at the end of a line of the batch file, followed by the log file name. E.g:
If you use one "arrow," each run of the batch will wipe the previous log. Two arrows will leave the previous run's entries. Use the "echo" command to write your own message, and then send that to the log, too.
Second, if you want to debug, you can send each command's output to a log file and check that. To do so, put one or two "greater than" signs at the end of a line of the batch file, followed by the log file name. E.g:
Code: Select all
copy c:\file1.* d:\target\* >> logfile.log