Johanvn Posted September 2, 2013 Share Posted September 2, 2013 (edited) Hello, I'm trying to create a script that writes a key to the regestry. When I run the script the key is added to the wrong regestry Im running windows 7 64bit when I run the script it is added in the 64bit regestry but I need it in the 32 bit regestry. the code thqt I use is regwrite("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon", "AutoAdminLogon", "REG_SZ", "1") Thanks for the help Edited September 2, 2013 by Johanvn Link to comment Share on other sites More sharing options...
lolipop Posted September 2, 2013 Share Posted September 2, 2013 the 32bit registry key on 64bit windows 7 is HKEY_LOCAL_MACHINESOFTWAREWow6432Node Your code should be something like this. regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") Link to comment Share on other sites More sharing options...
JohnOne Posted September 2, 2013 Share Posted September 2, 2013 You should test carefully exactly what is happening in your script because as far as I know the OS deals with what key to use in most cases (Assuming you do not disable registry redirection. Before you write to wow64, you might want to think about if you need this directive. #AutoIt3Wrapper_UseX64=n AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Johanvn Posted September 2, 2013 Author Share Posted September 2, 2013 the 32bit registry key on 64bit windows 7 is HKEY_LOCAL_MACHINESOFTWAREWow6432Node Your code should be something like this. regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") Tried this, the key is added but when I reboot the pc he does not auto logon with the defined user when I change the keys I mentionned befor it works. Link to comment Share on other sites More sharing options...
Johanvn Posted September 2, 2013 Author Share Posted September 2, 2013 You should test carefully exactly what is happening in your script because as far as I know the OS deals with what key to use in most cases (Assuming you do not disable registry redirection. Before you write to wow64, you might want to think about if you need this directive. #AutoIt3Wrapper_UseX64=n I don't want to write in wow64, The scripts does this I don't know why Link to comment Share on other sites More sharing options...
JohnOne Posted September 2, 2013 Share Posted September 2, 2013 Do you know what Wow6432Node is? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Johanvn Posted September 2, 2013 Author Share Posted September 2, 2013 Do you know what Wow6432Node is? This is the registry key that is used for redirecting the 64 bit regestry with the 32 registry? Link to comment Share on other sites More sharing options...
JohnOne Posted September 2, 2013 Share Posted September 2, 2013 So are you compiling/running your script as 64 bit application or 32 bit application AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Johanvn Posted September 2, 2013 Author Share Posted September 2, 2013 So are you compiling/running your script as 64 bit application or 32 bit application As 64 bit application I think But to be sure how can I verify this? Link to comment Share on other sites More sharing options...
Danyfirex Posted September 2, 2013 Share Posted September 2, 2013 (edited) So: If @AutoItX64 then MsgBox(0,"","Runing as x64") Else MsgBox(0,"","Runing as x86") endif For Writing I think, it should be so: #RequireAdmin $return=RegWrite("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","REG_SZ", "1") saludos Edited September 2, 2013 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Johanvn Posted September 3, 2013 Author Share Posted September 3, 2013 (edited) So: If @AutoItX64 then MsgBox(0,"","Runing as x64") Else MsgBox(0,"","Runing as x86") endif For Writing I think, it should be so: #RequireAdmin $return=RegWrite("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon","REG_SZ", "1") saludos It works. It seems that when I add the pc to the domain these registry keys change also but this helped me alot thx all Edited September 3, 2013 by Johanvn Link to comment Share on other sites More sharing options...
Danyfirex Posted September 3, 2013 Share Posted September 3, 2013 You're welcome. Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut 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