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 Task Scheduler job to run Robocopy for backing up local files to a network share. I have to use domain credentials to access the network share but the local computer is not on the domain, and the job is run as a local admin. This solution of temporarily mapping and unmapping the network share works but it leaves my password exposed in plain text for anybody who looks at the Task Scheduler job actions. I would prefer to map the network drive normally on a semi-permanent basis so the Task Scheduler job just has to run Robocopy and refer to the appropriate drive letter. However I always get the error "The system cannot find the path specified." in the Robocopy log when running this from Task Scheduler, even though the command works fine from an elevated command prompt (job is set to run with highest privileges). Also note I have done this registry tweak to access mapped drives from an elevated command prompt.

EDIT: To clarify, logged in as the local admin, I launch Windows Explorer as administrator. I map the network share to drive letter Y. I launch the command prompt as administrator and run

C:\Windows\System32\Robocopy.exe C:\temp Y:\temp

Works fine. I create a Task Scheduler job to run the exact same command, whether user is logged in or not, with highest privileges. I run it and get an error. I write to a log and get

ERROR 3 (0x00000003) Getting File System Type of Destination Y:\temp\
The system cannot find the path specified.

followed by

ERROR 3 (0x00000003) Creating Destination Directory Y:\temp\
The system cannot find the path specified.
share|improve this question
    
Does your local path or network path have spaces in them? If so, are you encapsulating the path with double quotes at the start and end of the path? –  Sun W Kim Sep 5 '13 at 5:00
    
@SunWKim No spaces in either path. –  Craig W Sep 5 '13 at 6:04
    
what is the command line you are using to perform the backup from local to network? What kind of network share are you backing up to? Makes me think perhaps the network share is not available (not connected) when you perform the backup command. –  Sun W Kim Sep 5 '13 at 16:33
    
Is it running as your user or just "an admin." If it's your user, is the drive persistently mapped for your user? –  Nick Sep 5 '13 at 22:40
    
@SunWKim Yes, the drive is connected after mapping. The local admin does not have rights to the network share which is why I have to map it as a different user before running Robocopy. –  Craig W Sep 9 '13 at 15:03
show 2 more comments

1 Answer

Mapped drives are a User Interface concept and are not available to background tasks like that. Access the target via UNC and make sure that the user that the task runs as has access to the target.

share|improve this answer
    
Not possible. The computer is not on the domain so I have to run the task as a non-domain user but only domain users have access to the network share. –  Craig W Sep 6 '13 at 17:14
add comment

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.