daslick Posted October 6, 2006 Share Posted October 6, 2006 I have a function that uses run-as, which I am trying to add a registry key with. I am trying to send the following commands to the function. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /freg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d 217.128.149.16:8080 /f I tried putting them inside my function _ra("here") but it doesn't work because of the quotes that have to be around the registry keys in order to tell that the words Internet and Settings go together. How do I work around this issue? Link to comment Share on other sites More sharing options...
Skruge Posted October 6, 2006 Share Posted October 6, 2006 Several options:If your _ra() function takes a commandline as a string parameter, try this:_ra('reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f')Use RegWrite() and have the script call itself as your other user. (Plenty of examples in the forum)Load the other user's hive and RegWrite it directly. (Ditto on examples) [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
daslick Posted October 6, 2006 Author Share Posted October 6, 2006 I can't use regwrite - the user is not an admin. My _ra() function uses the password to run the command. I wish I could use regwrite - it is much easier to use.... this is what I tried just now _ra('reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f') _ra('reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_SZ /d " & $proxy & " /f") and it did not work.... Link to comment Share on other sites More sharing options...
daslick Posted October 6, 2006 Author Share Posted October 6, 2006 Hold up... does httpsetproxy set the proxy for internet explorer or only if you are downloading files from within the program? If it saves the proxy settings I could use that... Link to comment Share on other sites More sharing options...
daslick Posted October 6, 2006 Author Share Posted October 6, 2006 Does regwrite use runasset()'s credentials? Link to comment Share on other sites More sharing options...
Skruge Posted October 6, 2006 Share Posted October 6, 2006 Hold up... does httpsetproxy set the proxy for internet explorer or only if you are downloading files from within the program? If it saves the proxy settings I could use that...It only affects InetGet/InetGetSize within your script.Does regwrite use runasset()'s credentials?No, not unless you're calling your own script with the RunAsSet credentials, as I suggested. See this thread for some examples: http://www.autoitscript.com/forum/index.php?showtopic=30015 [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] 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