Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a batch script which runs a robocopy. It is failing because the drive is not awake. enter image description here

In windows explorer, doubling clicking on that icon "wakes" up the link and the cross disappears and the robocopy runs without issue.

How can I wake it up in a batch file?

Additional Info: If my PC sleeps or reboots. The batch script does not run until i wake the drive via the icon. The two machines are not on a domain and they use the same username and password (administrator).

Additional Info 2: Note the unavailable drive.

Status       Local     Remote                    Network

OK           P:        \\fileserver2008\P        Microsoft Windows Network
Unavailable  T:        \\fileserver2008\T        Microsoft Windows Network
share|improve this question
+1 because I'm interested in the solution for this for re-connecting drive letters after OpenVPN connections become fully functional. – Randolf Richardson Nov 17 '11 at 6:13
I have added additional info – Valamas Nov 17 '11 at 10:12

I am not familiar with this problem but you may want to try out two things:

  1. Try running a Dir command against the drive and see if it wakes up: Dir T:\

  2. You can always disconnect and then connect the drive again from the command line, IE: from your batch program.

share|improve this answer
+1: Reconnecting has always worked for me. – surfasb Nov 17 '11 at 18:27
The dir command results in The system cannot find the path specified.. I know that reconnecting the drive would work. I wish to avoid it as I would like to find something else. – Valamas Nov 17 '11 at 20:06
Solution 1 doesn't work for me either. Solution 2 is a last resort, but it's not as slick as the automatic re-connect. +1 for a great effort though. – Randolf Richardson Nov 18 '11 at 7:47

How about pinging it's IP address, does that wake it up? Failing that see if there's some kind of WOL command to cause the disk to initialise...

share|improve this answer
This doesn't wake up Windows network drive mappings, unfortunately. This is because ICMP is an entirely different protocol from SMB. +1 for a good attempt though. – Randolf Richardson Nov 18 '11 at 7:48
+1 for the +1! Tend to always disable drive sleeping as all the network issues it used to cause... Old habits die hard :) – HaydnWVN Nov 18 '11 at 9:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .