RogueIT
Thu Jun 23 11:01:03 CDT 2005
I think I understand what you are asking and YES
Set oShell = CreateObject("WScript.Shell")
Dim Input
Input = InputBox("Enter Customer Number")
sKeyPath = "HKLM\SOFTWARE\DOHMEN\SettingsDPOS\" & input
oShell.RegWrite sKeyPath & "\custid", "&H270b", "REG_DWORD"
oShell.RegWrite sKeyPath & "\globaluid", input & "WDDA", "REG_SZ"
oShell.RegWrite sKeyPath & "\custname", input , "REG_SZ"
will crate the following registry entrys
[HKEY_LOCAL_MACHINE\SOFTWARE\DOHMEN\SettingsDPOS\9995]
"custid"=dword:0000270b
"globaluid"="9995WDDA"
"custname"="9995"
But I want to change "&H270B" TO "&H" & INPUT
"Torgeir Bakken (MVP)" wrote:
> RogueIT wrote:
>
> > OK. I have an input box come up and ask for customer number
> > Set oShell = CreateObject("WScript.Shell")
> > Dim Input
> > Input = InputBox("Enter Customer Number")
> > Inputpassword = InputBox("Enter Customer Password")
> > Inputstore = Inputbox("Enter Store Name")
> > sKeyPath = "HKLM\SOFTWARE\DOHMEN\SettingsDPOS\" & input
> >
> > oShell.RegWrite sKeyPath & "\custid", "&H270b", "REG_DWORD"
> > How would I take user input and convert to hex for the dword value?
> >
> > thanks in advance
> Hi,
>
> Is the "Customer Number" in the variable input supposed to be both a
> registry key, as well as the value data in the registry value custid?
>
> If it is supposed to be a key as well (the "...SettingsDPOS\" & input"
> part), is that key name represented as a hex value?
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
>
http://www.microsoft.com/technet/scriptcenter/default.mspx
>