Jump to content

Regread does not seem to be working under x64


Recommended Posts

Strange issue.  We have been using 32bit workstations until recently.  I have a very simple script to run Autologon from sysinternals, then read the value of a regkey, and disable the logoff button if needed

#Requireadmin


DirCreate("C:\AutoitTemp")
FileInstall("C:\Autologon.exe", "C:\AutoitTemp\Autologon.exe")




RunWait("C:\AutoitTemp\autologon.exe -accepteula")

$IsAutoLogonEnabled = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon")

   MsgBox(0, "Info", $isautologonenabled)

If $IsAutoLogonEnabled = 1 Then
   RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", "StartMenuLogoff", "REG_DWORD", 1)
   RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", "NoLogoff", "REG_DWORD", 1)
   MsgBox(0, "Info", "Logoff Disabled")
   EndIf


If $IsAutoLogonEnabled = 0 Then
   RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", "StartMenuLogoff", "REG_DWORD", 0)
   RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer", "NoLogoff", "REG_DWORD", 0)
   MsgBox(0, "Info", "LogOff Button Enabled")
EndIf

DirRemove("C:\AutoitTemp", 1)

the problem is, on x64 windows 7, the value seems to come back as NULL.  Works fine on 32bit.  If I compile the script as x64 it DOES work, but then will not run on 32bit.....

ideas?

Link to comment
Share on other sites

  • Moderators

Hi, wisem2540, please see the Remarks section of RegRead in the help file, specifically the second statement. It is pretty black and white.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...