backup scripts & scheduled tasks

Soldato
Joined
12 Nov 2002
Posts
14,600
Location
In my own little world
I've been trying to set up a backup script originally to run on a server 2000 machine to copy data back to the server from a directory on a win xp machine. This has worked on several sites on server 2000 and server 2003 with xp clients but for one site it just won't run. If I run the script on its own it works but scheduled tasks won't run it and gives the last result code as 0x1. This site had a new sever put in this week with Server 2003, so I was expecting it to now work but it doesn't. I've even tried setting the scheduled task up on the xp client to copy back to the server but again the script runs and works on its own but scheduled tasks just won't run it.

Code:
@echo off
:: variables
set drive=k:\

set backupcmd=xcopy /s /c /d /e /h /i /r /y

%backupcmd% "C:\Program Files\data"  "%drive%\data"


@stop

MW
 
set drive=k:
Otherwise you'll have two backslashes in the next command, and I know some commands are picky about unnecessary or excessive backslashes.

Or, wrong password on the scheduled task? Was the test done under the same account the scheduled task runs as? Is the K: drive a mapped network drive (visible to only the console/RDP session) or a local volume?
 
They were both running under administrator and I was logged in as administrator.

I've tried running the script to a mapped drive, to i.p\folder and to hostname\folder and they all work when the script is run but not when run through scheduled tasks.

MW
 
Back
Top Bottom