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 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
1  
I have added additional info –  Valamas Nov 17 '11 at 10:12

2 Answers 2

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
1  
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  
+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

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.