This will do the job, this is what we use.
Using Group Policy Objects to hide specified drives
Instead of using all that VBS code you can use a batch file
Code:
net use * /d /y
net use s: "\\sevrer\share"
net use t: "\\server\share"
or instead of using all that code to disconnect all those drives you can use this VBS code, providing your home drive letter is T, you can alter it though
Code:
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: Disconnect network drives left from previous login :::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
on error resume next
Set objNetwork = CreateObject("Wscript.Network")
For intLoop = Asc ("A:") To Asc ("s:")
objNetwork.RemoveNetworkDrive Chr (intLoop) & ":", TRUE, TRUE
Next
For intLoop = Asc ("U:") To Asc ("Z:")
objNetwork.RemoveNetworkDrive Chr (intLoop) & ":", TRUE, TRUE
Next
Wscript.Quit for you it will go
Code:
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: Disconnect network drives left from previous login :::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
on error resume next
Set objNetwork = CreateObject("Wscript.Network")
For intLoop = Asc ("H:") To Asc ("Z:")
objNetwork.RemoveNetworkDrive Chr (intLoop) & ":", TRUE, TRUE
Next
Wscript.Quit You will need to take out
if you are putting it into another script.