Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 8889

Mapped network drive resets on restart

$
0
0

I have a problem where my mapped network drive becomes unavailable after a restart, trying various solutions to make it persistent [/persistent:yes when re-mapping via PowerShell, etc.]:

  • net use Z: "\\10.0.1.145\xyz" connects the drive fine but doesn't persist past a restart

I wrote a script to automate this for me:

  • If ( !(Test-Path -Path "\\10.0.1.145\") ) {   net use Z: "\\10.0.1.145\xyz" /persistent:yes}
    • The odd thing is:
      Test-Path -Path "\\\10.0.1.145\\" = false
      Test-Path -Path "\\\10.0.1.145\xyz" = true

  • net use Z: "\\10.0.1.145\xyz" /persistent:yes gets the same result as the two Test-Path commands, with the only difference being Z: is accessible via CMD (Z: has been accessible via Explorer all along)

How can I map Z: persistently to 10.0.1.145 or reliably automate this if the former doesn't work?


Viewing all articles
Browse latest Browse all 8889

Trending Articles