Link to home
Start Free TrialLog in
Avatar of eemmpph
eemmpph

asked on

How can set robocopy.bat to run as a scheduled task in Windows 7?

My secretary has two folders  "client billing" and "client letters" on her computer (running Windows 7 Pro).  The goal is to make a daily backup (using robocopy) of those folders to an external disk drive for my computer.

I have created a folder ("Client Data") on my external disk drive, and shared it with my secretary, so that a copy of the client folders can be stored there.

My secretary's computer has a mapped network drive, letter "J",  folder \\mypc\Client Data". (This references the external disk drive on my computer).

I have created a batch file "roboclients.bat" on my secretary's computer, which contains two commands:

Robocopy "c:\client billing" "j:\Client Data\client billing" /MIR /dcopy:T /E /zb /r:1 /w:1 /LOG:c:\Billing.txt

Robocopy "c:\client letters" "j:\Client Data\client letters" /MIR /dcopy:T /E /zb /r:1 /w:1 /LOG:c:\Letters.txt

On my secretary's computer, I manually run "roboclients.bat" from the command prompt and it copies the client "billing" and "letters" folders to the J: drive successfully.

I have tried to "automate" this process using Task Scheduler.  

roboclients.bat fails to run, because the error is:  cannot find destination folder.

If I can run roboclients.bat successfully manually, why can't it run as an automated task at a designated time?

Secondly, how can I have roboclient.bat run regardless of whether the secretary has the computer "locked", or "logged off".

Your help is greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eemmpph
eemmpph

ASKER

I changed the "current user"  account under which the batch file would run, to "Administrator" account..

I removed the letter "j:\" from the destination path, and changed it to \\computername\external hard drive folder.

Problem solved!

Thank you very much.
Avatar of eemmpph

ASKER

Oh, one more thing, I did NOT ENABLE run with highest privileges.