Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduled task exits abnormally

Status
Not open for further replies.

drkrdr

IS-IT--Management
Jan 3, 2004
49
SE
I am trying to solve backup by simply copying files through scheduled tasks but I get

"Monday.job" (Monday.bat)
Finished 2004-06-11 22:46:15
Result: The task completed with an exit code of (4).

and no files copied. The user is Administrator. The batfile looks like this:
xcopy /yodecihk w:\Kontaktdb\*.* d:backup\monday\kontaktdb
xcopy /yodecihk w:\wedata1\*.* d:backup\monday\wedata1

and works fine running it online.
 
from what location is it running?
is it meant that the backslash in d:backup is missing?
is one of the drives a mapped network drive?
 
Lemon13,

It runs from C:\Documents...\Adminstrators.domain\My Documents\Backupbat

It seems that leaving out the backslash doesn't matter, I have tried both.

Yes, it is a mapped networked drive.

Technome,

I tried the UNC, i.e. I wrote \\server\folder in both source and target but I still get code 4. Even a dir at the command prompt \\server\folder yields Network path was not found.
 
I found on google groups searching on exit 4.
"Exit codes are generated by the application, not by Task Scheduler and or
the operating system. So you'll need to contact the application developer
for the meaning of the code."

I found this brief description of error code 4 with xcopy
"4
Initialization error occurred. There is not enough memory or disk space,
or you entered an invalid drive name or invalid syntax on the command
line. "


Maybe you need to have a / before each command when you run it from the taskscheduler. Try changing your syntax.
 
Had trouble running the xcopy command also.. my scheduled bat file(to xcopy files), initially would run, but after a a week or two the scheduled command would not work ( repeatable). I ended up using the robocopy command, no problem since.
 
How do I get hold of the robocopy command?
 
And can I use this Resource Kit download for W2K Server?
 
On advice, I changed the files to .cmd files and then it worked using UNC file names when referring to files and folders within the .cmd file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top