0

We have an issue with one computer (Win8) at work where after a cold boot the mapped drives show up but don't connect. This is not normally an issue as the user can enter the drives (despite the red X), but in this instance, the user uses software that accesses the mapped drive and the software/Windows wont allow it, as not being connected. This means that the user will have to restart the computer where the soft boot will connect the drives automatically.

We have all the user mapped drives connected through a bat file.

This would probably indicate the mapped drives trying to connect before the actual network connection being connected. We tried this fix:

Local Computer Policy > Computer Configuration > Administrative Templates > System > Logon > Enable: Always wait for the network at computer startup and logon

It worked for a few days but now the issue has creeped in again.

Any ideas?

2 Answers2

0

So you do not have to maintain batch files, all previously mapped drives a stored in registry... IF they had it before, try it again.

A simple powershell script, set to run as a task at user logon, and "wait for the following network connection to become available" in the task conditions...

Get-ChildItem HKCU:\Network | %{
    $d = $_.Name.Replace('HKEY_CURRENT_USER\Network\','')
    $p = $(Get-ItemProperty -Path Registry::$_  -Name "RemotePath").RemotePath
    NET USE $d`: /DELETE
    NET USE $d`: $p
 } 

We use it for users mapping over VPN, the VPN clients "Post connect" script is not as reliable as it should be.

Works great.

Sabre
  • 425
  • 2
  • 15
0

Have seen this before.

Changed the login script to delete the drive and re map it each time

net use /delete p: /y
net use p: \\server\share /persistent:yes

If its still not working, put in a ping or something to delay the script, like a ping.

@ECHO OFF
ping 127.0.0.1
net use /delete p: /y
net use p: \\server\share /persistent:yes

Doubt its the correct way, but its a fix

Dan
  • 26
  • 4
  • 1
    Please don't use `ping` to delay a batch file. https://serverfault.com/questions/432322/how-to-sleep-in-a-batch-file – Massimo Jun 22 '21 at 11:29