Using NET USE Command to Connect to Remote Resources


  1. Posts : 24
    Win 7 Pro 64 bit
       #1

    Using NET USE Command to Connect to Remote Resources


    My primary issue is that I have a least a couple of staff members whose PC's simply will not remember drive mappings from one logon to the next. The behavior is erratic. For example, on one user PC, one drive mapping to the local server drops everyday while another to the same server but different folder only drops sometimes.

    Also this user logs into a remote server from time to time using Citrix, and drives are mapped to the remote server resources. When not connected, they show up with a red X. However, one of three drive mappings to the remote server also drops everyday while the others remain in place.

    I figured I would solve the problem by setting up a logon script to map all the drives. But, this doesn't work for the remote drives... they are not connected at logon the the net use command fails.

    How can I go about either using this process or ensuring that the mapped drives don't get lost on the PC?

    TIA
      My Computer


  2. Posts : 369
    Windows 7 Pro 32bit
       #2

    Hi StrongEagle,

    Does this PC connected via DHCP?
    if Yes, do the IP's are reserved for each of the PC?
    if No, you need to set-up the IP reservations on your DHCP server.
    That could also be on the security settings of your mapped drives.
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #3

    Hey,

    The Net use command will make temporary drive mappings unless you supply the /persistant:yes switch. Once you do, the drive mapping will survive reboots.
      My Computer


  4. Posts : 24
    Win 7 Pro 64 bit
    Thread Starter
       #4

    Pyprohly said:
    Hey,

    The Net use command will make temporary drive mappings unless you supply the /persistant:yes switch. Once you do, the drive mapping will survive reboots.
    That's the problem... they are set to persistent, and they don't show up on reboot. I've done it through the GUI and through the command line interface... it makes no difference.

    Out of 20 or so Win 7 PC's about 3 people are experiencing this issue.
      My Computer


  5. Posts : 24
    Win 7 Pro 64 bit
    Thread Starter
       #5

    ShoTTaS said:
    Hi StrongEagle,

    Does this PC connected via DHCP?
    if Yes, do the IP's are reserved for each of the PC?
    if No, you need to set-up the IP reservations on your DHCP server.
    That could also be on the security settings of your mapped drives.
    All the PC's are DHCP IP assigned and none are reserved. The server, on which the drive mappings reside, is a static IP server.

    Why would setting reserved IP's make any difference when the mapping is to the server from the PC? I'm not saying I'm not going to try this, and I would like to understand the logic behind it.

    Thanks.
      My Computer


  6. Posts : 369
    Windows 7 Pro 32bit
       #6

    You need to reserved the IP.
    Computers connected to DHCP when not reserved, leases an IP and it has a time duration depending on what the administrator allocated on the server.
    If that leased IP expires, the next time you turned-on the PC, it will obtain a new IP from your DHCP.
    That could be the problem you are facing.

    For your reference, here's a link: The TCP/IP Guide - DHCP Lease "Life Cycle" Overview (Allocation, Reallocation, Renewal, Rebinding and Release) and Lease Timers

    I hope i have help you.
      My Computer


  7. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #7

    StrongEagle said:
    I've done it through [...] the command line interface
    So you've tried the following command on the staff members' machines?
    Code:
    net use /persistent:yes

    StrongEagle said:
    Out of 20 or so Win 7 PC's about 3 people are experiencing this issue.
    If it's just 3 of 20 users experiencing the same issue, you could temporarily evade the problem by placing a simple script (see below) in each of those users Startup folders that will run the net use command at login.

    Meanwhile, if you get the chance to do any testing, I would create a new user account on one of the problem PCs and check if the issue persists.


    MapDrive.vbs
    Code:
    Dim objShell, strCommand
    strCommand = "net use L: ""\\ComputerName\Share\Location\"""
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run strCommand,0
    Copy the VBScript to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" on all three PCs.
      My Computer


 

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

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