Task scheduler Problem

I have written a simple batch file using XCOPY to write new or changed files to a separate drive. It works great when I manually run it. I put it into the task scheduler and set it up to run once every evining. It supposedly runs and completes succesfully according to the info in Task scheduler HOWEVER NO FILE GET COPIED!! I change user groups, set it up to run even if not logged on, defined to run with the highest privileges, Run it as an administrator etc.

I'm out of ideas. Has anyone else had this issue? How do I fix it?

Thx

Mal Leichter

Hebron CT

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Hi Mal Leichter, This is Ramesh.

Please configure the task to run under your user account context. Also, add a "PAUSE" command at the end of the batch file to determine which commands failed to run correctly.

If possible, please share the task XML and the batch file so I can replicate the issue.

Share OneDrive files and folders - Microsoft Support: https://support.microsoft.com/en-us/office/shar...

:: OneDrive sharing options - screenshot ::
https://imgur.com/a/vZyxpY9
______________________________________________________________________________________________________

Ramesh Srinivasan
GMT +5:30

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Ramesh

Thanks for getting back to me!!!!

The Following is the Bat file:

echo Copy New or Updated files from MyCloudex2ultra to expansion drive for back up

xcopy "n:\Mal Data\*.*" "o:\Mal Data\*.*" /s /m /i /d /y /e

xcopy "n:\Maryanne Data\*.*" "o:\Maryanne Data\*.*" /s /m /i /d /y /e

echo Backup Complete

I have had the PAUSE command at the end of the file until yesterday and it is currently running under My ID and my ID has admin rights. When I run the file it pauses when I run it MANUALLY and it comcpletes and pauses with NO error messages. see attached. This shows no files backed up because I had just run the file (forgetting to put the PAUSE command back in). It was the same as you see below except it did copy 4 files to the o:\Mal Data and now it shows the PAUSE.

Image

When I run it using task scheduler It is Not visable and it appears that it complete succesfully See attached

Image

Hope this makes sense!!!!

Thanks

Mal

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Mal,

It's possible there are no matching files. Please drop the /D argument for testing purposes.

- - -
/D:m-d-y     Copies files changed on or after the specified date.
               If no date is given, copies only those files whose
               source time is newer than the destination time.

- - -



If that doesn't work, please share the task XML.
______________________________________________________________________________________________________

Ramesh Srinivasan
GMT +5:30

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Mal,

Please configure the task to run under your user account instead of "Administrators" to test if it works. Then, run the task and see if the commands return any errors.
______________________________________________________________________________________________________

Ramesh Srinivasan
GMT +5:30

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

The Batch File IS running under my account and it still saya it completes sucessfully yet no files are updated on the targhet drive. I then run the same batch file manually and files are found and written to the target drive.

There are no failures of the commands

Mal

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Some suggestions:

1) Try UNC paths instead of drive letters.

2) Output the xcopy command to a log file on the local computer by appending the command with the following.

>> "C:\xcopylog.txt"

3) Share the task XML.
______________________________________________________________________________________________________
Ramesh, Windows Shell MVP 2003-2012.
If this post resolves your issue, pls mark it as an Answer.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Can I assume that gets addete batch file as the last command ? OR does it get added to each command? I have never seen this on a batch file before but it is a great idea!!!

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Where do I find the task XML????

Thanks

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Where do I find the task XML????

Thanks

See:

https://www.windowscentral.com/how-export-and-import-scheduled-tasks-windows-10

______________________________________________________________________________________________________
Ramesh, Windows Shell MVP 2003-2012.
If this post resolves your issue, pls mark it as an Answer.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Can I assume that gets addete batch file as the last command ? OR does it get added to each command? I have never seen this on a batch file before but it is a great idea!!!

It should be the first line.

______________________________________________________________________________________________________
Ramesh, Windows Shell MVP 2003-2012.
If this post resolves your issue, pls mark it as an Answer.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated March 27, 2025 Views 141 Applies to: