Using NET USE Command to Connect to Remote Resources

StrongEagle

New member
Local time
2:54 PM
Messages
24
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

Computer type
PC/Desktop
OS
Win 7 Pro 64 bit
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Pro 32bit
CPU
Dual Core
Antivirus
Trend Micro
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

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
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

Computer type
PC/Desktop
OS
Win 7 Pro 64 bit
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

Computer type
PC/Desktop
OS
Win 7 Pro 64 bit
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Pro 32bit
CPU
Dual Core
Antivirus
Trend Micro
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


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

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top