Hi Folks,
I'm trying to remove a network drive ( K: ) mapped to our 200+ users. I created a VB Script and when I double click on some machine, it works without any issues. However, When I try to add this script as log on / log off script, it doesn'r remove network drive.
This logon script is not executing for some reason, in gpreport /h it shows blank under last run column.
However, rsop.msc shows this scirpt executed.
Below is my script.
-------------------------------------
Option Explicit
Dim objNetwork, strDriveLetter, objFSO
'strDriveLetter = "K:"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("WScript.Network")
' Section to mcheck and remove K drive
If (objFSO.DriveExists("K:") = True) Then
objNetwork.RemoveNetworkDrive "K:", True, True
End If
Wscript.Quit
-------------------------------------
I'm trying to remove a network drive ( K: ) mapped to our 200+ users. I created a VB Script and when I double click on some machine, it works without any issues. However, When I try to add this script as log on / log off script, it doesn'r remove network drive.
This logon script is not executing for some reason, in gpreport /h it shows blank under last run column.
However, rsop.msc shows this scirpt executed.
Below is my script.
-------------------------------------
Option Explicit
Dim objNetwork, strDriveLetter, objFSO
'strDriveLetter = "K:"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("WScript.Network")
' Section to mcheck and remove K drive
If (objFSO.DriveExists("K:") = True) Then
objNetwork.RemoveNetworkDrive "K:", True, True
End If
Wscript.Quit
-------------------------------------