ski3987 Posted July 22, 2010 Share Posted July 22, 2010 Hello, i am new to AutoIT and need some help. I would like to create a simple script/program to ask the user what to input. Once I have that input i would like to modify a specific registry setting and import that back into the registry. Can anyone help me with this. Thank you Link to comment Share on other sites More sharing options...
jaberwacky Posted July 22, 2010 Share Posted July 22, 2010 Look into the registry functions such as regwrite, regdelete, etc in the helpfile. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
ski3987 Posted July 23, 2010 Author Share Posted July 23, 2010 lets say i wanted to add a site the the trusted site list. If i wanted to add *.aaa.com i would import the following registry key: [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\aaa.com] "*"=dword:00000002 i see i can add the key as follows: RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\aaa.com") question is how do i also add "*"=dword:00000002 and make it so the "aaa.com" is whatever value the user inputs? Thank you, Link to comment Share on other sites More sharing options...
ALTIN Posted July 23, 2010 Share Posted July 23, 2010 Here you have what you are asking for: $value = InputBox("User input", "Enter your input:") If ($value <> "") Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" & $value, "*", "REG_DWORD", "00000002") EndIf Link to comment Share on other sites More sharing options...
ski3987 Posted July 23, 2010 Author Share Posted July 23, 2010 Thank you, i would also like to add a feature to this program to run "gpupdate /force" I think i can run gpupdate by using: Run("gpupdate /force") _WinWaitActivate("C:\WINDOWS\system32\gpupdate.exe", "") Send("n{ENTER}n{ENTER}") can you help me in creating a button that would give me the option to run gpupdate /force Thank you, Link to comment Share on other sites More sharing options...
ski3987 Posted July 29, 2010 Author Share Posted July 29, 2010 Thank you, i would also like to add a feature to this program to run "gpupdate /force" I think i can run gpupdate by using: Run("gpupdate /force") _WinWaitActivate("C:\WINDOWS\system32\gpupdate.exe", "") Send("n{ENTER}n{ENTER}")can you help me in creating a button that would give me the option to run gpupdate /forceThank you, Link to comment Share on other sites More sharing options...
JML Posted August 3, 2010 Share Posted August 3, 2010 Here you have what you are asking for: $value = InputBox("User input", "Enter your input:") If ($value <> "") Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" & $value, "*", "REG_DWORD", "00000002") EndIf I got this part easily enough, but how do I execute a RegWrite command to HKLM if the user doesn't have local admin rights? I tried RunAs("username" , "domain" , "password" , @SystemDir & "\REG.EXE Add HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains /v $value /t REG_DWORD /d 2 /f"), but it doesn't change the registry value. Is there a way to do a RunAs( "username" , "domain" , "password" , RegWrite("HKLM...")? 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