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.
eemmpphAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
The user running the task is shown under "When running the task, user the following user account". If that is wrong, change it using the Change User button.

> roboclients.bat fails to run, because the error is:  cannot find destination folder.
If j: is a mapped network drive letter, you'll need to map it somewhere in the batch file that runs

> Secondly, how can I have roboclient.bat run regardless of whether the secretary has the computer "locked", or "logged off".
Set the "Run whether user is logged on or not".
You may need to also set "Run with highest privileges"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David Johnson, CD, MVPOwnerCommented:
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 

Open in new window

I would change J:\ to \\desinationcomputername\

and NOT run with highest privileges.
1
eemmpphAuthor Commented:
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.
0
eemmpphAuthor Commented:
Oh, one more thing, I did NOT ENABLE run with highest privileges.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Networking

From novice to tech pro — start learning today.