xCROv Posted May 18, 2018 Share Posted May 18, 2018 I'm having a strange issue where some registry keys are not being completed but the rest in the function are. I am running on a local admin account and am able to update WSUS reg keys but not Winlogon keys for auto login. Has anyone run into this issue before? I have @RequireAdmin running at the top of my script and am kinda out of ideas. Works RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", "AcceptTrustedPublisherCerts", "REG_DWORD", "00000001") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", "ElevateNonAdmins", "REG_DWORD", "00000000") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", "WUServer", "REG_SZ", "http://10.1.1.10:8530") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", "WUStatusServer", "REG_SZ", "http://10.1.1.10:8530") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate", "DisableOSUpgrade", "REG_DWORD", "00000001") ___ Doesn't work RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon", "REG_SZ", "1") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", "username") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", "hunter2") Link to comment Share on other sites More sharing options...
Developers Jos Posted May 18, 2018 Developers Share Posted May 18, 2018 Probably related to 32/64 bits. Look in the wowxxxx tree for those saved keys. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
xCROv Posted May 18, 2018 Author Share Posted May 18, 2018 1 minute ago, Jos said: Probably related to 32/64 bits. Look in the wowxxxx tree for those saved keys. Jos I seriously just saw your post suggesting the exact same thing from 2 years ago and that's the issue. There is a dll call you can make to prevent it doing this that I am going to hunt down and throw in there but it looks like that's the problem. Thanks! https://www.autoitscript.com/forum/topic/183292-regwrite-does-not-work-properly/?do=findComment&comment=1316379 Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted May 18, 2018 Share Posted May 18, 2018 Disable Wow64Redirection, or just use HKLM64 Link to comment Share on other sites More sharing options...
Subz Posted May 18, 2018 Share Posted May 18, 2018 Global $sHKLM = @OSArch = "x64" ? "HKLM64" : "HKLM" RegWrite($sHKLM & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") RegWrite($sHKLM & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon", "REG_SZ", "1") RegWrite($sHKLM & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", "username") RegWrite($sHKLM & "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", "hunter2") Link to comment Share on other sites More sharing options...
kosamja Posted May 18, 2018 Share Posted May 18, 2018 58 minutes ago, Subz said: Global $sHKLM = @OSArch = "x64" ? "HKLM64" : "HKLM" What to use if script is compiled as 64 bit, HKLM or HKLM64? Link to comment Share on other sites More sharing options...
Subz Posted May 18, 2018 Share Posted May 18, 2018 (edited) If its compiled as 64 bit you can still use either HKLM or HKLM64, I don't tend to ever compile any 64 bit scripts since haven't found any use for them. If I need to run 64 bit programs I use: Global $iCmdProcess If @OSArch = "x64" Then ;~ 64 bit Process DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection $iCmdProcess = Run("cmd.exe /k") DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns On 64 Bit Redirection Else ;~ 32 bit Process $iCmdProcess = Run("cmd.exe /k") EndIf Edited May 18, 2018 by Subz 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