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?
Thanks!
1 Comment   [ + ] Show Comment

Comments

  • 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
    TGCS
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.

Answers

0
Hi turbokitty

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

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctinputbox.asp

br
andler
Answered 10/13/2005 by: andler
Orange Belt

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

Please log in to comment
0
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,_
strKeyPath,strValueName1,Input1
objReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,_
strKeyPath,strValueName2,Input2


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 ;-)

Regards,
Chaitra
Answered 10/20/2005 by: artiahc_elay
Senior Yellow Belt

Please log in to comment
0
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
Answer this question or Comment on this question for clarity