Trouble Mapping Network Drives

Discussion in 'Networking & Security' started by Dan, Aug 29, 2018.

  1. Dan

    Dan [H]ardness Supreme

    Messages:
    7,298
    Joined:
    May 23, 2012
    I have a brand new Windows 7 Pro PC and I'm trying to map drives from a different Windows 7 Pro PC as well as a NAS. When I simply just map the drives and than reboot the PC the drives are either missing or have a red X through them and need to be clicked on to "activate" them.

    To resolve this I tried to run a mapping script every time the computer boots... however I'm getting an error when the script runs and nothing is mapping. When I manually map it or try to connect with \\pc-name\folder it connects fine.
    The error usually is "System Error 53 Has Occurred The network path was not found"

    An example of the script I'm running is as follows (the timeout is to give the PC time to establish a network connection... it has an SSD and boots quickly):

    timeout /t 5
    net use a: /delete
    net use b: /delete
    net use c: /delete

    net use a: \\nasbox\Folder
    net use b: \\nasbox\Folder 2
    net use c: \\win7pro-pc\Folder​
     
  2. scobar

    scobar .

    Messages:
    34,147
    Joined:
    Jan 2, 2001
    Do you specify a user to use/connect to the network path? How do you authenticate?
     
    Spartacus likes this.
  3. dbwillis

    dbwillis [H]ardness Supreme

    Messages:
    6,995
    Joined:
    Jul 9, 2002
    Whats the letter of your OS drive...not C?

    why use A, B, C?
     
    scobar likes this.
  4. scobar

    scobar .

    Messages:
    34,147
    Joined:
    Jan 2, 2001
    Hoping these are variables for something like m:, n:, o:.
     
  5. grumpy_rock

    grumpy_rock Limp Gawd

    Messages:
    284
    Joined:
    Sep 7, 2010
    What happens when you run the script manually?
    can you map the drives using ip address?
     
  6. Dan

    Dan [H]ardness Supreme

    Messages:
    7,298
    Joined:
    May 23, 2012
    Just an example. Really using other letters like H, X, Z
    Exactly
    To answer your other question, the folders I'm trying to connect to are shared with "everyone" and the computer does not have a password on it. If I simply open an explorer window and type //computername it comes right up.
    If I run the script manually the exact thing happens. If I map it manually in windows without the script using the exact same address (//nasbox/folder) it works fine. I can try replacing the name with the IP address and see if it likes that better and report back. Might be tough to do today because of the holiday weekend but I'll give it a go.
     
  7. grumpy_rock

    grumpy_rock Limp Gawd

    Messages:
    284
    Joined:
    Sep 7, 2010
    try pinging the other machines by name? Maybe a name resolution problem, that is why i suggested using the ip address. I cannot remember if the GUI resolves name differently than the command line. It has been a while.

    Try the steps below for network discovery
    1. go to Control Panel
    2. Select Network and sharing center
    3. Select Advanced sharing settings
    4. Turn off network discovery and file sharing
    5. Save changes and close
    6. reboot the machine
    7. go back into sharing center
    8. Turn on network discovery and file sharing
     
  8. Spartacus

    Spartacus [H]ard|Gawd

    Messages:
    1,857
    Joined:
    Apr 29, 2005
    Yep, that's my first thought.

    Even though Windows lets you use an account with a blank password, it will not let you use an account with a blank password to authenticate
    from another system to access resources. It won't let you RDP with a blank password either.

    Also..... it's easy to specify an account/password with the net use command. That will connect to the resource without manually entering a password.

    .
     
    scobar likes this.
  9. Dead Parrot

    Dead Parrot [H]ard|Gawd

    Messages:
    1,908
    Joined:
    Mar 4, 2013
    Where is the script PC getting its IP address from? Wondering if the on boot script is running before the IP stack has settled down. Might account for the manual script running correctly while the on boot script fails.

    Try including a ping command to ping a network device you know is up and running when the PC boots.
     
  10. Dan

    Dan [H]ardness Supreme

    Messages:
    7,298
    Joined:
    May 23, 2012
    I can ping both by name and IP address. I tried the reboot trick you recommended and same issue is happening
    The PC that we are connecting to does not have a password, I'll see if I can add one and give it a shot. The only issue is a bunch of people connect to it and they are all working fine so I'm weary to play with that computer and possibly;y cause issues with everyone else.
    The PC running the script is DHCP getting the IP from the router. I set a 7 second delay before the script starts mapping drives to give the PC time to establish a network connection. I can try a little longer delay if you think that will help. Or I can try a static IP on the PC possibly.
    .
     
  11. Dead Parrot

    Dead Parrot [H]ard|Gawd

    Messages:
    1,908
    Joined:
    Mar 4, 2013
    I know from watching my PC boot that the little icon for Network status sometimes takes a while to show good. Not sure when that happens compared to when boot scripts try to run.
    Might include something like this in your script: (not real script language, been too long since last needed one.)

    while(ping [nasbox address] == FAIL)
    { print '.'; pause 1 second}

    rest of your scrip.
    set the script window to remain after completion during your testing. Number of . printed will give some idea of network ready lag.
     
    Spartacus likes this.
  12. Spartacus

    Spartacus [H]ard|Gawd

    Messages:
    1,857
    Joined:
    Apr 29, 2005
    >>The PC that we are connecting to does not have a password, I'll see if I can add one and give it a shot. The only issue is a bunch of people connect to it and they are all working fine so I'm weary to play with that computer and possibly;y cause issues with everyone else.

    It doesn't have to be the main account you are using to authenticate. You could makeup a new account "drives" with password "drives" and test with that.
    Then just always use the drives account in your scripts.

    Also..... try the PERSISTENT switch on the mappings. "net use /?" for help.

    .
     
  13. bloodypulp

    bloodypulp Gawd

    Messages:
    904
    Joined:
    May 17, 2010
    use a Group Policy
     
  14. Dan

    Dan [H]ardness Supreme

    Messages:
    7,298
    Joined:
    May 23, 2012
    OK... I did some major Googling and found a workaround that did the job perfectly it seems.

    Here is the magical youtube video: youtu.be/q8KVJdgewNk

    They wrote a script that is set to run minimized on boot up. The script essentially checks to see if the network is active, than checks to see if any network drives are down, and if there are it reconnects them and it skips over the ones that are OK. It's not a really a mapping script so those map drive errors I was having aren't a thing.

    Thank you all for your input. This work around fixes my solution