Scheduled task to map a network drive runs, but doesn't map the drive

Posted by bikefixxer on Super User See other posts from Super User or by bikefixxer
Published on 2010-04-30T00:14:31Z Indexed on 2010/04/30 0:17 UTC
Read the original article Hit count: 545

Filed under:
|

I have a task set up to run whenever the computer is logged onto that deletes all network folders and maps a network drive. Here is what is in the batch file:

@echo off
net use * /delete /y
net use b: \\Server\Share /user:DOMAIN\Username password
exit

When the computer is restarted or logged off and back on, the task runs fine (according to the scheduled tasks window saying when it ran last) but the mapped drive doesn't show up. I'll open the command prompt and type "net use" and it simply says "There are no entries in the list". If I then right click on the task and run it, it works and the mapped drive shows up.

I've checked the log and nothing shows up. I've tried adding a timer in the batch file so it waits 10 seconds (ping 1.1.1.1 -n 1 -w 10000>nul) thinking that maybe the network wasn't connected, but that didn't work. What else can I try?

Thanks!

© Super User or respective owner

Related posts about scheduled-tasks

Related posts about batch-file