crushr Posted February 10, 2012 Share Posted February 10, 2012 Hi, I'm trying to get WMI proxy behavior working for a script. Got this code from a previous thread: $objWMIService2 = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\CIMV2\Applications\MicrosoftIE") $colIESettings3 = $objWMIService2.ExecQuery ("Select * from MicrosoftIE_LANSettings") Getting the following error on execution: Variable must be of type "Object".: $colIESettings3 = $objWMIService2.ExecQuery ("Select * from MicrosoftIE_LANSettings") $colIESettings3 = $objWMIService2^ ERROR In an earlier thread it was recommended I get the production version of AutoIt (not beta)--I've confirmed I'm on v3.3.8.1, I think that should be the most recent stable version right? Any idea how I can either get this object or any alternative way to clear the IE proxy so I can set another proxy mid-script execution? Link to comment Share on other sites More sharing options...
UEZ Posted February 10, 2012 Share Posted February 10, 2012 Are you sure that rootCIMV2ApplicationsMicrosoftIE exists or you have classes within rootCIMV2ApplicationsMicrosoftIE? You can verify it with wbemtest. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
crushr Posted February 10, 2012 Author Share Posted February 10, 2012 Thanks UEZ! I just tried wbemtest (I think) and got "Invalid namespace." Wasn't sure if I tested correctly so I screen captured the effort. Can you check it out?http://screencast.com/t/MNe9YKF35DJeff Link to comment Share on other sites More sharing options...
UEZ Posted February 10, 2012 Share Posted February 10, 2012 Yes, it seems that the namespace is not available.Better overview of all namespaces can be seen with Scriptomatic.Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
crushr Posted February 10, 2012 Author Share Posted February 10, 2012 (edited) Thanks for checking it out. So what should I do in order to change proxy midway through a script execute? For example with the below method of changing proxy handling: $HKEY_CURRENT_USER = 0x80000001 $strComputer = "." $objRegistry = ObjGet("winmgmts:" & $strComputer & "rootdefault:StdRegProv") $strKeyPath = "SOFTWAREMicrosoftWindowsCurrentVersionInternet Settings" $strValueName = "ProxyEnable" $dwValue = 1 $objRegistry.SetDWORDValue ($HKEY_CURRENT_USER, $strKeyPath, $strValueName, $dwValue) $strValueName = "ProxyServer" $strValue = "111.111.111.111:8800" ; The proxy IPs I'm using are working fine, they just can't be changed mid-execution $objRegistry.SetStringValue ($HKEY_CURRENT_USER, $strKeyPath, $strValueName, $strValue) $strValueName = "ProxyOverride" $strValue = "<local>" $objRegistry.SetStringValue ($HKEY_CURRENT_USER, $strKeyPath, $strValueName, $strValue) How can I then clear the proxy IP (111.111.111.111:8800) during script execution and then use a different one? Edited February 10, 2012 by crushr Link to comment Share on other sites More sharing options...
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