On install, I want a custom action to launch a vbs and prompt the user to input some data. Then I want this data (an email address and later a phone number) to populate some registry keys.
I think this should be fairly easy to do... if I knew much VBS.. which I don't (I'm learning!).
Any help?
1 Comment   [ - ] Hide Comment


  • Hi,
    Sorry for bumping an old post but I have just found and tried this with the following results:
    1) as-is the script appears to create and populate registry keys and values under HKCU (even though the constant is named HKEY_LOCAL_MACHINE)
    2) if I change line 10 to:
    const HKEY_LOCAL_MACHINE = &H80000002
    and then run it again it runs OK but no keys and values appear in HKLM
    I'm not great with VBScripting - can anybody explain why this isn't working and suggest a solution.
    Thanks in Advance
Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Hi turbokitty

In vbscript you have two dialogboxes, MsgBox and InputBox.
In your case you'll need to use the inputbox.


Answered 10/13/2005 by: andler
Orange Belt

Please log in to comment
That gets me started.. thanks andler.
Answered 10/13/2005 by: turbokitty
Sixth Degree Black Belt

Please log in to comment
hey kitty,

Sorry I might be late, if iam not hope this helps

Set WshShell = WScript.CreateObject("WScript.Shell")
Input1 = InputBox("Enter E-mail address")
MsgBox ("You entered: " & Input1)
Input2 = InputBox("Enter Phone Number")
MsgBox ("You entered: " & Input2)

Set WshShell = CreateObject("WScript.Shell")
const HKEY_LOCAL_MACHINE = &H80000001
strComputer = "."
Set objReg=GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Personal Info"
objReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
WScript.Echo "Created registry key HKEY_LOCAL_MACHINE\SOFTWARE\Personal Info"

strValueName1 = "Email Address"
strValueName2 = "Phone Number"

objReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,_
objReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,_

this script creates a key called Personal Info under HKCU\SOFTWARE\ and also creates 2 values names email address and Phone number and populates the value data with user input. pretty simple eh ;-)

Answered 10/20/2005 by: artiahc_elay
Senior Yellow Belt

Please log in to comment
Thank you! Yes, a bit late but it gives me some ideas for my next script. Cheers.
Answered 10/28/2005 by: turbokitty
Sixth Degree Black Belt

Please log in to comment