I have a script that performs 3 things for a user on their workstation:
1) maps a printer
2) sets an environment variable
3) maps a drive letter "P:"
This "P:" drive is mapped from a TS server that the user also has the ability to log into when they are away remotely. On the TS server there is a physical drive "P:" that is the same drive. The script is supposed to block the "P:" mapping when they log in remotely through TS but it errors on the if then statement. Is there a easy way to fix this? Here is the script:
objNetwork.AddWindowsPrinterConnection "\\SVCTAG-DXB78F1\SAVIN802"
Set oShell = WScript.createObject("WScript.Shell")
Set oEnv = oShell.Environment("USER")
oEnv("PP_PRINT") = "SAVIN802"
Set objNetwork = Createobject("wscript.Network")
If not exists "P:" Then
objNetwork.MapNetworkDrive "P:" , "\\SVCTAG-DXB78F1\Data"
End IF
Thanks for any insight, JR
1) maps a printer
2) sets an environment variable
3) maps a drive letter "P:"
This "P:" drive is mapped from a TS server that the user also has the ability to log into when they are away remotely. On the TS server there is a physical drive "P:" that is the same drive. The script is supposed to block the "P:" mapping when they log in remotely through TS but it errors on the if then statement. Is there a easy way to fix this? Here is the script:
objNetwork.AddWindowsPrinterConnection "\\SVCTAG-DXB78F1\SAVIN802"
Set oShell = WScript.createObject("WScript.Shell")
Set oEnv = oShell.Environment("USER")
oEnv("PP_PRINT") = "SAVIN802"
Set objNetwork = Createobject("wscript.Network")
If not exists "P:" Then
objNetwork.MapNetworkDrive "P:" , "\\SVCTAG-DXB78F1\Data"
End IF
Thanks for any insight, JR