Jump to content
Sign in to follow this  
Johanvn

Regestry changes

Recommended Posts

Johanvn

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 by Johanvn

Share this post


Link to post
Share on other sites
lolipop

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")

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
Johanvn

 

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.

Share this post


Link to post
Share on other sites
Johanvn

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

Share this post


Link to post
Share on other sites
Johanvn

Do you know what Wow6432Node is?

This is the registry key that is used for redirecting the 64 bit regestry with the 32 registry?

Share this post


Link to post
Share on other sites
Johanvn

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?

Share this post


Link to post
Share on other sites
Danyfirex

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 by Danyfirex

Share this post


Link to post
Share on other sites
Johanvn

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 by Johanvn

Share this post


Link to post
Share on other sites
Danyfirex

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×