Wrong with overwriting the registry editor file to AHK?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
daiweisc
Posts: 46
Joined: 19 Oct 2019, 04:27

Wrong with overwriting the registry editor file to AHK?

Post by daiweisc » 30 Mar 2023, 07:26

The operation failed after overwriting the registry editor file to AHK. What is the problem?

1.The code for the Registry Editor is as follows:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Yrankyurt\mydict\Customer Info]
"SerialCode"="Welcome back to mydict"
"TimesLeft3"=dword:000c85e7
"regDate"="2020/4/20 00:00:00"
"LicenseCode"="Welcome back to mydict"
2.The AHK code is as follows:

Code: Select all

#NoEnv
#SingleInstance,force
KeyName := "HKEY_CURRENT_USER\SOFTWARE\Yrankyurt\mydict\Customer Info"
SerialCode1 := "Welcome back to mydict"
TimesLeft1 := "000c85e7"
regDate1 := "2020/4/20 00:00:00"
LicenseCode1 := "Welcome back to mydict"
;-----------------------------------------------------------------
RegWrite, REG_SZ, %KeyName%, "SerialCode", %SerialCode1%
RegWrite, REG_DWORD, %KeyName%, "TimesLeft3", %TimesLeft1%
RegWrite, REG_SZ, %KeyName%, "regDate", %regDate1%
RegWrite, REG_SZ, %KeyName%, "LicenseCode", %LicenseCode1%
Sleep, 1000
ExitApp

gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Wrong with overwriting the registry editor file to AHK?

Post by gregster » 30 Mar 2023, 07:30

Probably a permissions issue. See https://www.autohotkey.com/docs/v1/FAQ.htm#uac
You could also check for errors: https://www.autohotkey.com/docs/v1/lib/RegWrite.htm#Error_Handling

The literal quotes around "SerialCode" and the other ValueNames look unusual. Are they really present in the original registry keys?

daiweisc
Posts: 46
Joined: 19 Oct 2019, 04:27

Re: Wrong with overwriting the registry editor file to AHK?

Post by daiweisc » 30 Mar 2023, 19:48

Thanks for reply. The code for the Registry Editor run well. No problem.

Post Reply

Return to “Ask for Help (v1)”