0
xcopy "C:\RS\Automation - Reporting Service\CW\bella_%date:~4,2%-%date:~7,2%-%date:~10,4%.SLS" "C:\Program Files (x86)\Common Files\Countwise\Retail_Reporting\DATA" /e /y /h

xcopy "C:\RS\Automation - Reporting Service\CW\bella_%date:~4,2%-%date:~7,2%-%date:~10,4%.HRS" "C:\RS\Automation - Reporting Service\CW\bevello_%date:~4,2%-%date:~7,2%-%date:~10,4%.HRS" /e /y /h

I keep getting an error saying that I system file path cannot be found. This only occurs when the script is run as a scheduled task.

The directory is exist and it seems like problem with user permission.

Can anyone help?

Thanks!

Pekka
  • 3,529
  • 27
  • 45
D.RYU
  • 23
  • 6
  • possible duplicate of [Allow access permission to write in Program Files of Windows 7](http://stackoverflow.com/questions/946420/allow-access-permission-to-write-in-program-files-of-windows-7) – Pekka Apr 25 '15 at 16:20
  • Hi, it is windows server 2012 – D.RYU Apr 25 '15 at 16:25
  • It means a problem with what you typed. 'path cannot be found` does not mean permissions. So the window will show you the name after expansion. What does that say? – Trigger Apr 25 '15 at 21:32
  • When I double click the batch file to run the file, it works fine. But when I run through the task scheduler, it does not work. – D.RYU Apr 26 '15 at 04:02
  • Force `echo ON` in your batch file and add some `pause` to keep command window open. Then [edit] your question and copy&paste error message with it's crucial surroundings (i.e., follow @Trigger) – JosefZ Apr 26 '15 at 19:36
  • 1
    If you are european date person, system account uses US dates so your dates will be wrong not dd/mm/yyyy but mm/dd/yyyy. – Trigger Apr 27 '15 at 01:04
  • You need to ensure that the Scheduled task runs in the correct user context. Change the user name the task uses to provide adequate permissions. – Pekka Apr 27 '15 at 18:25

0 Answers0