0

I have a windows server that I created a BAT file that basically goes into a network sharefolder and copies a file to a different location. When I run the BAT file manually it works perfectly. When I schedule the file nothing happens. Is there something scheduler doesn't like about sharefolders?

1 Answers1

0

Yeah, totally, in that scheduled tasks run an an anonymous user unless you specifically tell it to run under a user account that has privileges to access the network.

Usually you'll create a service-specific user account (sometimes just a generic EXAMPLE\ScheduledTasks account), set the scheduled task to run as that user, and give that user access to the network share.

Note that this will then run the scheduled task under that users profile, so any scripts that use things like %UserProfile% will point to that users profile.

For debugging, try piping your copy command to a file in a known location. E.g. robocopy /mir c:\local\folder \\server\remote\folder > %TEMP%\RoboCopyLog.txt

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259