Can I use registrywritekey> to write a numeric string value?
I want to configure the change HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\forceautologon to 1, but the following command creates a dword value rather than a string value, which doesn't work.
RegistryWriteKey>HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon,forceautologon,1
I can have MS execute a reg file to accomplish this, but I'd rather not.
Thanks for the help.
registrywritekey problem
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Hi petersa2.....
There is a MS variable to let REGistry INTegers be written AS a STRing.
Try this:
Hope this helps.....good luck....
There is a MS variable to let REGistry INTegers be written AS a STRing.
Try this:
Let>REG_INTASSTR=1
RegistryWriteKey>HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon,forceautologon,1
Hope this helps.....good luck....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Is There A Way When Writing Into The Registry That You Can Specify What Value The Registry Key Should Be.
REG_DWORD
REG_SZ
REG_BINARY
I Am Currently Wanting To Enter Some Data Into The Registry Via A Macro Which I Will Convert To An Exe & Have The System Deploy It.
The Data I Want To Add Is Below.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\0]
"Source"="\\Emfile0009c02\strve-f03$\BFS\SATELLITE\L2 BOH\Allen, Michael John\BigPond\BP.htm"
"SubscribedURL"="\\Emfile0009c02\strve-f03$\BFS\SATELLITE\L2 BOH\Allen, Michael John\BigPond\BP.htm"
"FriendlyName"=""
"Flags"=dword:00002002
"Position"=hex:2c,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,e4,02,00,00,00,\
00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00
"CurrentState"=dword:40000002
"OriginalStateInfo"=hex:18,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,e4,02,\
00,00,02,00,00,40
"RestoredStateInfo"=hex:18,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,e4,02,\
00,00,01,00,00,00
I Am Wanting To Be Able To Enter The Key Value Eg. REG_DWORD, REG_SZ, REG_BINARY, However Every Time It Will Enter The Data As REG_SZ.
--
Michael Allen
NURV | CyberCitizen
"If you spend more on coffee than on IT security, you will be hacked."
White House cybersecurity advisor, Richard Clarke
REG_DWORD
REG_SZ
REG_BINARY
I Am Currently Wanting To Enter Some Data Into The Registry Via A Macro Which I Will Convert To An Exe & Have The System Deploy It.
The Data I Want To Add Is Below.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\Components\0]
"Source"="\\Emfile0009c02\strve-f03$\BFS\SATELLITE\L2 BOH\Allen, Michael John\BigPond\BP.htm"
"SubscribedURL"="\\Emfile0009c02\strve-f03$\BFS\SATELLITE\L2 BOH\Allen, Michael John\BigPond\BP.htm"
"FriendlyName"=""
"Flags"=dword:00002002
"Position"=hex:2c,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,e4,02,00,00,00,\
00,00,00,01,00,00,00,01,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00
"CurrentState"=dword:40000002
"OriginalStateInfo"=hex:18,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,e4,02,\
00,00,02,00,00,40
"RestoredStateInfo"=hex:18,00,00,00,00,00,00,00,00,00,00,00,00,04,00,00,e4,02,\
00,00,01,00,00,00
I Am Wanting To Be Able To Enter The Key Value Eg. REG_DWORD, REG_SZ, REG_BINARY, However Every Time It Will Enter The Data As REG_SZ.
--
Michael Allen
NURV | CyberCitizen
"If you spend more on coffee than on IT security, you will be hacked."
White House cybersecurity advisor, Richard Clarke
Last edited by CyberCitizen on Tue Mar 01, 2005 11:53 pm, edited 1 time in total.
You can do it with VBScript. Here's an example:
VBSTART
Sub RegExample
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Popup "Create key HKCU\MyRegKey with value 'Top level key'"
WSHShell.RegWrite "HKCU\MyRegKey\", "Top level key"
WSHShell.Popup "Create key HKCU\MyRegKey\Entry with value 'Second level key'"
WSHShell.RegWrite "HKCU\MyRegKey\Entry\", "Second level key"
WSHShell.Popup "Set value HKCU\MyRegKey\Value to REG_SZ 1"
WSHShell.RegWrite "HKCU\MyRegKey\Value", 1
WSHShell.Popup "Set value HKCU\MyRegKey\Entry to REG_DWORD 2"
WSHShell.RegWrite "HKCU\MyRegKey\Entry", 2, "REG_DWORD"
WSHShell.Popup "Set value HKCU\MyRegKey\Entry\Value1 to REG_BINARY 3"
WSHShell.RegWrite "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY"
WSHShell.Popup "Delete value HKCU\MyRegKey\Entry\Value1"
WSHShell.RegDelete "HKCU\MyRegKey\Entry\Value1"
WSHShell.Popup "Delete key HKCU\MyRegKey\Entry"
WSHShell.RegDelete "HKCU\MyRegKey\Entry\"
WSHShell.Popup "Delete key HKCU\MyRegKey"
WSHShell.RegDelete "HKCU\MyRegKey\"
End Sub
VBEND
VBRun>RegExample
VBSTART
Sub RegExample
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Popup "Create key HKCU\MyRegKey with value 'Top level key'"
WSHShell.RegWrite "HKCU\MyRegKey\", "Top level key"
WSHShell.Popup "Create key HKCU\MyRegKey\Entry with value 'Second level key'"
WSHShell.RegWrite "HKCU\MyRegKey\Entry\", "Second level key"
WSHShell.Popup "Set value HKCU\MyRegKey\Value to REG_SZ 1"
WSHShell.RegWrite "HKCU\MyRegKey\Value", 1
WSHShell.Popup "Set value HKCU\MyRegKey\Entry to REG_DWORD 2"
WSHShell.RegWrite "HKCU\MyRegKey\Entry", 2, "REG_DWORD"
WSHShell.Popup "Set value HKCU\MyRegKey\Entry\Value1 to REG_BINARY 3"
WSHShell.RegWrite "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY"
WSHShell.Popup "Delete value HKCU\MyRegKey\Entry\Value1"
WSHShell.RegDelete "HKCU\MyRegKey\Entry\Value1"
WSHShell.Popup "Delete key HKCU\MyRegKey\Entry"
WSHShell.RegDelete "HKCU\MyRegKey\Entry\"
WSHShell.Popup "Delete key HKCU\MyRegKey"
WSHShell.RegDelete "HKCU\MyRegKey\"
End Sub
VBEND
VBRun>RegExample
MJT Net Support
[email protected]
[email protected]
- CyberCitizen
- Automation Wizard
- Posts: 724
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia