Windows – Why does the scheduled task fail with error (0x4)

scheduled-taskstask schedulerwindows

I have a scheduled task that is supposed to run a batch file. The batch files runs file when called on it's own, but does not run when wrapped in a scheduled task.

Here is what the dialog looks like:

enter image description here

Best Answer

In my case the solution was to replace the mapped drive with the fully qualified path. So instead of:

XCOPY C:\DATA Z:\ (where Z is the drive mapped to \\SERVER\DATA$)

I changed to:

XCOPY C:\DATA \\SERVER\DATA$

I run the task as Administrator and it worked like a charm.

Related Question