I'm writing a little applet that basically tells you when Windows was installed. There is a REG_DWORD in Windows that gives you this. It's basically a value that is the # of seconds from 1970.
The location is: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate"
So if I run this in AutoIT, I should get the value displayed within the msgbox:
MsgBox($MB_SYSTEMMODAL, "InstallDate Test", RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate"))
However, what happens is it always returns a value of "0" I tried this on several machines (Windows 8, Windows 8.1 and Windows 10).
Am I missing something? If I manually view this REG_DWORD with RegEdit, it shows me the HEX value, or I can view the Decimal value. I don't care which value AutoIT reads, as I can always convert back and forth, but I just don't see why it can't read a value from this REG_DWORD. As a test, I've read other REG_DWORD values, and with most it doesn't return any value, not even a 0.
Please, even if you guys have some other (perhaps better) way to read the Windows install date, I would still like to find a resolution to this problem, because I want to understand why I am having so much difficulty with reading REG_DWORD values from the Windows Registry with AutoIT.
Thanks for any help!
I want to determine if AutoLogon is enabled on a Windows 10 Pro (64-bit) system. It's my understanding that the following registry key will exist and equal 1 if autologon is enabled, or equal 0 if disabled.
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon So l looked up RegRead in AutoIt's help file and tested the example.
#include <MsgBoxConstants.au3> Local $sVar = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") MsgBox($MB_SYSTEMMODAL, "Program files are in:", $sVar) The resulting message box says: C:\Program Files (x86)
Regedit says the value in ProgramFilesDir is C:\Program Files. "C:\Program Files (x86)" is in a nearby key "ProgramFilesDir(x86)", which makes sense.
I ignored this anomaly and tried RegRead in my own script:
#include <MsgBoxConstants.au3> $isEnabled = RegRead("Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon") If $isEnabled = 1 then MsgBox($MB_SYSTEMMODAL, "", "Autologon enabled.") Else MsgBox($MB_SYSTEMMODAL, "", "Autologon disabled.") EndIf My punishment for ignoring the problem with the Help file example is that regardless of whether the AutoAdminLogon key equals 0 or 1 in reality, my script's $isEnabled variable returns 0.
Despite the problem with the RegRead example I still figure I'm at fault, but I would appreciate someone pointing out my mistake, please.
I'm trying to write an autoit script to select from the dropdown list as you see in the attached picture.
I read the help page for _IEFormElementOptionSelect, but I cannot grasp how to correlate that with the source code that I'm seeing. any suggestions?
I created a quick script to set/clear the topmost status of a window. It works like
top <title> /on | /off
I want the title match to be case insensitive and to work on partial strings. For example, if the window of note is titled "APLX for Windows" I want
top apl /on
to work. The AutoIt manual says that for WinTitleMatchMode
Mode -1 to -4
Force lower case match according to other type of match.
so I assumed that by
I would be doing a lower case match on existing windows. As long as I lcase(title) for the comparison it should match on "APLX for Windows" but it does not Is this a bug or am I misreading the docs?
I am trying to build a list from a query run against a sybase db. This part works fine. My problem is this, I want to display values in a list depending
on the value of certain fields i.e. See below which works for two. Unfortunately, I need it to work for 3 values. I don't know how I can do this for 3. I did try doing a select case but I was getting errors.
i.e. if value =0 then "Card Check" if Value = - Then "Card Spend" Else "Money Added"
The below immediate iif works brilliantly for two but as I say I need to build this with 3 different values.
$idItem = GUICtrlCreateListViewItem( _iif($adoRs.Fields("TransactionAmount").value =0, "Card check","Money Added")
Any help appreciated.