Hi all,
Ive been tearing my hair out trying to work this one out. I had it working (if the key exists) its when the key doesnt exist its a problem. Im trying to delete the proxy server registry key as per
My code then goes on to check group membership and map drives. But I cant seem to get the first section to check if the reg key exists then go onto the next task.
Am I being a muppet? Thanks :)
Ive been tearing my hair out trying to work this one out. I had it working (if the key exists) its when the key doesnt exist its a problem. Im trying to delete the proxy server registry key as per
Code:
Option Explicit
Dim WSHNetwork, DomainString, UserString, UserObj, GroupObj, wshShell, regValue, regKey
Set wshShell = WScript.CreateObject("Wscript.Shell")
wshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"
regKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
If IsNull(regKey) then
End IF
Else
wsShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
End sub
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = WSHNetwork.UserDomain
UserString = WSHNetwork.UserName
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)Am I being a muppet? Thanks :)