How to delay mounting network drives

Page 2 of 2 FirstFirst 12

  1. Posts : 7,607
    Windows 10 Home 20H2
       #11

    @pkillpeers, I think it could be possible to use only VBScript without a batch/CMD script.
    On your desktop, right-click on the "A script.vbs" file-->"Edit". Delete everything, copy the following lines into it, and save the changes.

    WScript.Sleep 6000
    CreateObject("WScript.Shell").Run("net use E: ""\\SomePC\SomeShare"""),0

    Replace SomePC and SomeShare with the actual names and change the drive letter E if necessary as Compumind said before.
    The command WScript.Sleep 6000 will cause a delay of 6 seconds. 1000 denotes 1 second.
    Double-click on the VBScript file to run it. No command window will appear. See whether the script works. If it works, just copy it into the "Startup" folder.
      My Computer


  2. Posts : 8
    Windows 10 Pro 1909
    Thread Starter
       #12

    Matthew Wai said:
    @pkillpeers, I think it could be possible to use only VBScript without a batch/CMD script.
    On your desktop, right-click on the "A script.vbs" file-->"Edit". Delete everything, copy the following lines into it, and save the changes.

    WScript.Sleep 6000
    CreateObject("WScript.Shell").Run("net use E: ""\\SomePC\SomeShare"""),0

    Replace SomePC and SomeShare with the actual names and change the drive letter E if necessary as Compumind said before.
    The command WScript.Sleep 6000 will cause a delay of 6 seconds. 1000 denotes 1 second.
    Double-click on the VBScript file to run it. No command window will appear. See whether the script works. If it works, just copy it into the "Startup" folder.
    Hey! thanks for improoving the script!
    How would i add a second line to that? i have to 2 drives to mount
      My Computer


  3. Posts : 7,607
    Windows 10 Home 20H2
       #13

    WScript.Sleep 6000
    CreateObject("WScript.Shell").Run("net use E: ""\\SomePC\SomeShare"""),0
    CreateObject("WScript.Shell").Run("net use F: ""\\SomePC\SomeShare"""),0

    Replace E and F with the actual drive letters.
      My Computer


  4. Posts : 8
    Windows 10 Pro 1909
    Thread Starter
       #14

    Matthew Wai said:
    WScript.Sleep 6000
    CreateObject("WScript.Shell").Run("net use E: ""\\SomePC\SomeShare"""),0
    CreateObject("WScript.Shell").Run("net use F: ""\\SomePC\SomeShare"""),0

    Replace E and F with the actual drive letters.
    It worked like a charm!!! Thanks so much man!!
      My Computer


  5. Posts : 7,607
    Windows 10 Home 20H2
       #15

    You are most welcome!
      My Computer


  6. Posts : 2
    Windows 10
       #16

    Reviving an old thread. The script is working fine - do I need to remove my existing mappings and the "reconnect at login"?

    I am using mapped drives with a different login and password from my Windows account. Will this cause issues if I replace my current mappings with the script?
      My Computer


  7. Posts : 2,800
    Windows 7 Pro
       #17

    There is a useful GPO for that

    Computer Configuration -> Administrative Templates -> System -> Logon ->

    “Always Wait for the Network at Computer Startup and Logon” to “Enabled”

    This will make windows wait for the network before opening session. Used a lot in corporate env.
      My Computers


  8. Posts : 2
    Windows 10
       #18

    Unfortunately this is a work machine and I don't have access.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:22.
Find Us




Windows 10 Forums