Keep Mapped Location Open

By | November 22, 2020

If windows continually drops a remote location you can keep it open with this:

do{start-process \\server\path ;start-sleep 5 $a = (New-Object -comObject Shell.Application).Windows() |?{$_.FullName -ne $null} |? {$_.FullName.toLower().Endswith(‘\explorer.exe’)} $a | %$_.Quit() }Start-sleep 3600}while ($True)