lingk Posted August 2, 2007 Posted August 2, 2007 I have some notebook users that need to be abel to change there proxy settings when they are off site. would it be possible to make a batch file or vbscrip they could click on to switch these settings?
gunsmokingman Posted August 2, 2007 Posted August 2, 2007 I have some notebook users that need to be abel to change there proxy settings when they are off site. would it be possible to make a batch file or vbscrip they could click on to switch these settings?I do not know if this is what you wanted but read this Link
lingk Posted August 2, 2007 Author Posted August 2, 2007 ok so here is the scrip, it works but i want to build onto it. I want it to check the strValueName = "ProxyEnable"dwValue = 1 if the dwValue is 1, then set it to 0 and if it's 0 run the rest of the script to set it to 1 and add the proxy settings. this way the user doesn't have to click differently scrips, just click when they get home and click it again when they are done. when the user logs in back on the domain the GPO policy doesn't seam to be in effect after the script has ran.Const HKEY_CURRENT_USER = &H80000001strComputer = "."Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"strValueName = "ProxyEnable"dwValue = 1objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValuestrValueName = "10.193.24.6"strValue = "svcproxy:800"objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValuestrValueName = "ProxyOverride"strValue = "<local>"objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue
gosh Posted August 2, 2007 Posted August 2, 2007 you could possibly make an .ins file that has the settings. you could possibly use ieak to install it.-gosh
gunsmokingman Posted August 2, 2007 Posted August 2, 2007 Here a quick Example of how you could do what you want it to.const HKEY_CURRENT_USER = &H80000001strComputer = "."Set objRegistry=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv")'/-> Read The Value strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" strValueName = "ProxyEnable" objRegistry.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue'/->Check The Value If dwValue = 0 Then '/-> If Value Was 0 Then Set It To One dwValue = 1 objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue Else '/-> If Value Was 1 Then Set It To Zero dwValue = 0 objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue End If
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now