Delay mounting network drive at boot?

Anonymous
2010-04-17T12:13:51+00:00

I have a network drive that I have mapped as a drive on my toshiba nb205 notebook.  It works fine with one exception, boot-up time. 

When the notebook is booted it can never connect to the mapped drive, if I manually open the drive it will then connect and be fine.

My theory is that windows is trying to connect to the drive before the network connection is established. 

Is there a way to delay mounting the network attached drive until the network establishment is complete?

Windows for home | Previous Windows versions | Internet and connectivity

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-04-17T13:17:11+00:00

Try this:

  1. Click Start, then type the three letters cmd into the Search box and press Enter.
  2. Type these commands and press Enter after each:

    net use /persistent:no

    net use * /del /yes

    notepad "%UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\netlogon.bat

  1. Type the following lines:

    @echo off

    set delay=60

    ping localhost -n %delay%

    net use E: "\SomePC\SomeShare"

  1. Save and close the file

From now on your network connection(s) will be made 60 seconds (or whatever delay you set) after you log on. You must, of course, replace "SomePC" and "SomeShare" with actual names. You also need to be careful with your typing. The commands I used will not tolerate many variations.

Was this answer helpful?

70+ people found this answer helpful.
0 comments No comments

45 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-10-08T18:19:27+00:00

    Hi Oberwald

    Thanks for posting that answer. I have used it to connect to my NAS unit but the cmd box asks for a username and password, I can type these manually and it connects fine but it there any way to add this to your script?

    Many thanks in advance

    James

    Was this answer helpful?

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2012-08-12T10:26:11+00:00

    Liking this batch, but i have one question. Won't the loop command keep on searching for the server if it isn't available, using resources? If i'm not on my home network, i won't have my laptop searching for the NAS all day.

    I use the batch in the 2nd post my htpc, but the command window shows up instantly, pinging until the network drive is connected. Isn't it possible to have this window working in the backgrond, not visible?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-07-14T17:53:19+00:00

    May be an oldie but a great refrence.  Many thanks for helping with issues relating to getting this to work on a new tablet.

    for anyone else's refrence: with a big kudos to Oberwald this is what i came up with.

    @ECHO OFF

    Echo Checking For Internet Connection...

    set ServerIP=74.125.227.71 {checks for internet using Google IP: Lets my aircard have time to connect}

     :Loop

     ping %ServerIP% -n 2 | find /i "bytes=" > nul && goto Connect

     ping localhost -n 180 > nul

     goto Loop

    :Connect

    rasdial [VPN connection Name] [login] [password] {This connects to WorkPlace VPN that is already set up}

    set ServerIP=192.168.x.x {Servers IP Address where my shares are located Want to check to make sure server is online before connecting}

     :Loop2

     ping %ServerIP% -n 2 | find /i "bytes=" > nul && goto Connect2

     ping localhost -n 180 > nul

     goto Loop2

    :Connect2

    Echo Connecting to Shares

    net use Q: "\\192.168.x.x\Share 1" /u:[domain\login] [password] {note space in share name}

    net use A: \\192.168.x.x\Share2 /u:[domain\login] [password]

    net use Z: \\192.168.x.x\Share3 /u:[domain\login] [password]

    net use U: \\192.168.x.x\Share4 /u:[domain\login] [password]

    Was this answer helpful?

    0 comments No comments