CompEng
CompEng

Reputation: 7376

Task Scheduler error 0X1 How can I solve this?

I write a bat file to copy .zip to another location. The file copy from localhost to another pc.(the disc is defined as R)

I wrote this commands:

@echo off 
move /Y "C:\xx\yy.zip" R:\xx
cd /D R:\xx\
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c%%a%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
ren "yy.zip" "yy%mydate%_%mytime%.zip"

The problem is in the task scheduler is I set folder location,and select bat file, and ** I set run whether user log on or not** and select high privileges then it gives 0X1 error. But if I deselect whether user log on or not tick it works. But I need to tick it

How can I solve this?

thanks in advance

Upvotes: 2

Views: 35205

Answers (1)

MichaelS
MichaelS

Reputation: 6032

I think the problem is that you only have the rights to write to the remote drive when a user is logged in that also has ther rights to do so. You should add the machine with the scheduled task to the administrator group of the remote pc.

Upvotes: 3

Related Questions