Hello,

I am trying to create a script that will accept input from a user (4
different values) and then write them to the registry. I have the
portion of code completed to create the reg keys and strings but am
having issues with asking the user for input then writing it to the
location I just created.
Any help would be greatly appreciated.

Thank you,

mint_fo@yahoo.com

Re: VBScript to accept user input and write to registry by KP

KP
Wed Jan 26 15:11:07 CST 2005


Dim strReturnVal, strName, strKeyName, strType
Dim g_objShell :Set g_objShell = createobject("WScript.Shell")

strName = "HKEY_LOCAL_MACHINE\SOFTWARE" 'Change path to correct
location.
strKeyName = "\UsrInputString"
strtype = "REG_SZ"

GetUserInput strReturnVal

'//Add your code here to put strReturnVal into reg!
g_objShell.RegWrite strname & strKeyName, strReturnVal,strType

' User Input Function
Sub GetUserInput(strReturnVal)
Dim strChoice
' MsgBox is Used to Make InputBox Modal.
MsgBox "Prompting for User Input"
strChoice = InputBox(strStandardMsg & _
"Select Server Usage Template","")

If strChoice = "" Then
'Flag an Error is Null
strReturnVal = "BAD Usage"
else
strReturnVal = strChoice
end if
End Sub