J
Jenny
I'm attempting to get a batch file I have created (that
copies files from 1 directory to another directory by
stopping/restarting services that lock those files) to run
as a scheduled task. The batch file runs perfectly when I
attempt to run it manually, but when I try to run it as a
scheduled event, it stops after executing the "remove
directory" command. The commands I'm using are pretty
simple:
@Echo Off
Net Stop "Service Name1"
Net Stop "Service Name2"
Net Stop "Service Name3"
rd "D:\Main Directory\file folder\files\" /q/s
xcopy "M:" "D:\Main Directory\file
folder\files\" /e/q/h/y/r/i
Net Start "Service Name3"
Net Start "Service Name2"
Net Start "Service Name1"
I've checked and rechecked to ensure I'm using the
administrative user/password when scheduling the event,
but am still not having any luck. The directory gets
removed just fine, but the file copying doesn't happen at
all. Any ideas why this may be happening and/or possible
solutions would be greatly appreciated!![Smile :) :)](/styles/default/custom/smilies/smile.gif)
..
copies files from 1 directory to another directory by
stopping/restarting services that lock those files) to run
as a scheduled task. The batch file runs perfectly when I
attempt to run it manually, but when I try to run it as a
scheduled event, it stops after executing the "remove
directory" command. The commands I'm using are pretty
simple:
@Echo Off
Net Stop "Service Name1"
Net Stop "Service Name2"
Net Stop "Service Name3"
rd "D:\Main Directory\file folder\files\" /q/s
xcopy "M:" "D:\Main Directory\file
folder\files\" /e/q/h/y/r/i
Net Start "Service Name3"
Net Start "Service Name2"
Net Start "Service Name1"
I've checked and rechecked to ensure I'm using the
administrative user/password when scheduling the event,
but am still not having any luck. The directory gets
removed just fine, but the file copying doesn't happen at
all. Any ideas why this may be happening and/or possible
solutions would be greatly appreciated!
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
..