Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
    

3 Answers 3

If you are trying to copy these folders to a network share, it will not work because the scheduled task is run as 'System'. If this is the case, you have to specify which user the task is Run As.

Source

share|improve this answer
    
@mmcglynn in the general tab, check out the user/group it is run under there. Enable the history on the item, and the history on the whole thing also , you will see more usefull errors. For me it was some stupid thing with the batch I forget what, but one of the batches wouldnt run hidden, I assume as security?? You will get it, but it can be a pain. Also running right after a boot can fail , a delay could solve that. –  Psycogeek May 18 '12 at 1:09
    
@mmcglynn The link isn't toast, your computer is. I have accesed it from two different computers, as I said earlier. –  ekaj May 19 '12 at 4:53
    
Did you ever try my suggestion? –  ekaj Jul 7 '12 at 6:02

I managed to get around this by using a combination of the Robocopy utility (for its more robust logging and error handling) and the NET USE command.

NET USE B: \\remote-machine\location RemotePassword /user:remote-machine\RemoteUserName

robocopy.exe B:\ D:\backups /NP /LOG+:D:\robocopy\robocopy.log /R:10 /W:5

This script maps the remote location to the network drive B: using the specified username and password for the remote machine.

Robocopy then copies the contents of the folder on the network location to the D:\backups folder. This will also log details to the specified robocopy log file so you can see how many files have been copied etc.

share|improve this answer

It guess. But high possible. Execution of .bat or .cmd really imply execution of cmd.exe In Windows for some (I think security) reasons, cmd.exe os executable only for interactive user. So it only can be executed when user logged in locally.

Give some group right to execute cmd.exe as sheduled task and assign user from whom executing this task to this group.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.