gjm72 Posted May 28, 2005 Share Posted May 28, 2005 I am very new to autoit so bare with me. Our computers are running windows xp some with sp2 some with sp1 pro we have about 150 of them. Here is my problem. I need to change the proxy server address in internet explorer and since we are using per machine rather per user settings for the proxy address the value that needs to be changed is located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyServer","REG_SZ","http://192.168.100.2:8080" How can i create a script to grab admin rights from the machine it is being run on so that the script can change the ip address. If anyone can post a script for this that would be great. Thank you!!! Link to comment Share on other sites More sharing options...
GaryFrost Posted May 28, 2005 Share Posted May 28, 2005 Not sure about the grabbing admin rights part, but what we do is a run as You might want to take a look at the RunAsSet in the help. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
/dev/null Posted May 28, 2005 Share Posted May 28, 2005 For some proxy setting UDFs, check out this thread IE proxy UDFs, 2 UDFs for IE proxy settings.For the admin stuff, use RunAsSet and Run. However, then you can't just use the UDFs from the thread mentioned above. Btw. Why would you need admin rights to set the reg key? The UDFs use HKCU\...., where the user should have read/write access.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
gjm72 Posted May 28, 2005 Author Share Posted May 28, 2005 I need admin rights because the proxy setting is per machine so the setting is in the hklm part not the hkcu part. Here is the script i tried to use, but it doesn't work. ; Set the RunAs parameters to use local adminstrator account RunAsSet("Administrator", @Computername, "password") ; Run registry editor as admin RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyServer","REG_SZ","http://192.168.1.2:8080") ; Reset user's permissions RunAsSet() Link to comment Share on other sites More sharing options...
/dev/null Posted May 28, 2005 Share Posted May 28, 2005 ; Set the RunAs parameters to use local adminstrator accountRunAsSet("Administrator", @Computername, "password"); Run registry editor as adminRegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyServer","REG_SZ","http://192.168.1.2:8080"); Reset user's permissionsRunAsSet()As I said in my last post. You cant use RunAsSet with internal functions (RegWrite). RunAsSet has only an effect on Run(). The only way would be to use an external program like reg.exe an WinXP.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
gjm72 Posted May 28, 2005 Author Share Posted May 28, 2005 i wrote a program to make the change and call it from my script and it works perfect. thanks for the pointer. 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