Running RoboCopy as a Schedueled Task

Hello,

First time posting a question on Experts Exchange so i apologize if this is a long post firsthand.

I am trying to setup Robocopy as a Scheduled Task. When it runs when i am logged off my Windows 2008 server all that happens is the Files from the Source that i create as test files get deleted and nothing is copied. If i run the batch file normally while logged in it runs correctly and files are copied over. I am newish to Robocopy so i want to make sure i am putting in the command correctly with correct syntax and switches. Please review below and let me know if more info is needed and what other suggestions you might have. Also i am testing this in a Windows 2008 environment but the task has to be in a Windows 2003 environment unfortunately i can't test from that environment as of yet

Robocopy command: robocopy E:\TEMP \\192.168.XXX.XX\e$\Test /copyall /e /r:2 /w:5 /log+:c:\Logs\log.txt

Log File last result from Scheduled task logged off and afterwards what i receive when running it normally logged on:

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Tue Sep 04 10:43:57 2012

   Source : E:\TEMP\
     Dest : \\192.168.XXX.XX\e$\Test\

    Files : *.*
         
  Options : *.* /S /E /COPYALL /R:2 /W:5

------------------------------------------------------------------------------

                         0      E:\TEMP\
      *EXTRA Dir        -1      \\192.168.XXX.XX\e$\Test\2\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         1
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

   Ended : Tue Sep 04 10:43:57 2012
_________________________________________________________________________________________
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Tue Sep 04 11:08:18 2012

   Source : E:\TEMP\
     Dest : \\192.168.XXX.XX\e$\Test\

    Files : *.*
         
  Options : *.* /S /COPYALL /R:2 /W:5

------------------------------------------------------------------------------

                         0      E:\TEMP\
                         3      E:\TEMP\2\
      *EXTRA Dir        -1      \\192.168.XXX.XX\e$\Test\2\test\
        *EXTRA File                   54      test1.txt
        New Dir          0      E:\TEMP\2\jontest\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         3         1         2         0         0         1
   Files :         3         0         3         0         0         1
   Bytes :   161.2 k         0   161.2 k         0         0        54
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

   Ended : Tue Sep 04 11:08:18 2012
MB_IT_SupportAsked:
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.

David Johnson, CD, MVPOwnerCommented:
personally I'd use a batch file and call the batch file otherwise it looks fine to me.

net use z: /d
net use z: \\192.168.xxx.xxx\e$
if errorlevel  0 goto startcopy
echo "net use failed" >>c:\Logs\log.txt
goto end
:startcopy
robocopy E:\TEMP z:\Test /copyall /e /r:2 /w:5 /log+:c:\Logs\log.txt
if errorlevel 0 goto end
echo "robocopy generated an error>> c:\logs\log.txt
:end
net use z: /d

Open in new window



you may have to add login parameters for the net use command or the script will stall
nappy_dThere are a 1000 ways to skin the technology cat.Commented:
Make sure that you set Robocopy to run as system and not as user.

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
MB_IT_SupportAuthor Commented:
I was able to get my original application working but will take notes on these solutions as i will use Robocopy again.

Thank you.
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
Storage Software

From novice to tech pro — start learning today.