wisem2540 Posted May 23, 2013 Share Posted May 23, 2013 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 More sharing options...
wisem2540 Posted May 23, 2013 Author Share Posted May 23, 2013 So I may have posted too soon. If I change the regread to HKLM64, it works. So am i going to have to change all my scripts to if @osversion = X64..... else..... Or is there an easier way to make it more compatible? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 23, 2013 Moderators Share Posted May 23, 2013 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 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