Help With Script Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
brodiemac
Posts: 4
Joined: 26 Feb 2016, 09:30

Help With Script

02 Apr 2018, 08:47

I'm trying to create a script for setting up new computers. We want to add new registry keys that will incorporate an asset number and a description. What I have so far works up to creating the registry and the two keys but the values will not populate. I am no expert so I was hoping someone might be able to see why this isn't working.

Thanks.

Code: Select all

Gui, Add, Text, x32 y29 w100 h30 +Right, Asset #:
Gui, Add, Edit, x142 y29 w100 h30 Number Limit5 vAsset, 
Gui, Add, Text, x32 y69 w100 h30 +Right, Description:
Gui, Add, DropDownList, R5: x142 y69 w100 h21 vDescription, MSR|MRA|MSR Training|HR Training|DR|Check Scanning|Seminar
Gui, Add, Button, x32 y179 w100 h30 , OK
Gui, Add, Button, x142 y179 w100 h30 , Cancel
; Generated using SmartGUI Creator 4.0
Gui, Show, x127 y87 h239 w306, New GUI Window
Return

ButtonCancel:
GuiClose:
Gui, Cancel
return

ButtonOK:
Gui, Submit
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE\Software\Company, CompanyAssetNumber, %vAsset%
RegWrite, REG_SZ, HKEY_LOCAL_MACHINE\Software\Company, CompanyDescription, %vDescription%
ExitApp
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: Help With Script  Topic is solved

02 Apr 2018, 09:26

There is an extra "v" in the variable names under the ButtonOK label (i.e. it should just be %Asset% and %Description%).
brodiemac
Posts: 4
Joined: 26 Feb 2016, 09:30

Re: Help With Script

02 Apr 2018, 09:38

How did I miss that?

Thank you!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], peter_ahk and 314 guests