Quantcast
Viewing all articles
Browse latest Browse all 26364

Mapped drives deleted when working remotely

My client is using the following VBScript to map drives on their sbs2008 server and this works fine for the most part but the CEO has an issue when working from home via a VPN, when she logs on to her laptop, connects the VPN then goes into 'Computer' the mapped drive is no longer present but it works fine when working in the office.

I assume that the script may be deleting the mapped drive possibly because it can't locate the shared folder when she logs on but I'm only guessing here as I know very little about vbs.

If anyone can shed some light on what I need to do in order to make the mapped drives persistent that would be great.

*****

MapDrive "X:","\\wcusvr\Source"
MapDrive "P:","\\wcusvr\Public"
MapDrive "S:","\\wcusvr\Shared"
wscript.quit

Function MapDrive(strDriveLetter,strPath)
set objNet = CreateObject("Wscript.Network")
set objFSO = CreateObject("Scripting.FileSystemObject")

if not ( objFSO.DriveExists(strDriveLetter) ) then
objNet.MapNetworkDrive strDriveLetter,strPath
else
set objDrive = objFSO.GetDrive(strDriveLetter)
if not (objDrive.ShareName = strPath) then
objNet.RemoveNetworkDrive strDriveLetter,true,true
objNet.MapNetworkDrive strDriveLetter,strPath
end if
end if

End Function

****


Thanks

Mike


Viewing all articles
Browse latest Browse all 26364

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>