maximaal
asked on
Registry adds in vbs??
I have a .reg file, working fine. But now i want to add the registry add to the login script (vbs)
Most of it is no problem. But the Hexadecimal is drivin me insane.
How can i add this to my login script, on a easy way??
(
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Explo rer\Cabine tState]
"Settings"=hex:0c,00,02,00 ,1b,01,e7, 77,60,00,0 0,00
"FullPath"=dword:00000001
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Polic ies\Explor er]
"NoSaveSettings"=dword:000 00000
)
tnx
Most of it is no problem. But the Hexadecimal is drivin me insane.
How can i add this to my login script, on a easy way??
(
[HKEY_CURRENT_USER\Softwar
"Settings"=hex:0c,00,02,00
"FullPath"=dword:00000001
[HKEY_CURRENT_USER\Softwar
"NoSaveSettings"=dword:000
)
tnx
I think WSH RegWrite will write at most one DWORD (= FOUR bytes of binary data) to a REG_BINARY value. Larger values are not supported with this method.
I usually just create the .REG file and shell out regedit /s myfile.reg to add the registry edits.
if you want to get real fancy you can try WMI (with XP and Win2K)
Set oReg=GetObject("winmgmts:{ impersonat ionLevel=i mpersonate }!\\" & sComputer & "\root\default:StdRegProv" )
sKeyPath = "Software\MicrosoftWindows \CurrentVe rsion\Expl orer\Cabin etState\"
sValueName = "Settings"
oReg.SetBinaryValue HKCU, sKeyPath, sValueName, aValueData
But I'm not the best with WMI stuff :-)
I usually just create the .REG file and shell out regedit /s myfile.reg to add the registry edits.
if you want to get real fancy you can try WMI (with XP and Win2K)
Set oReg=GetObject("winmgmts:{
sKeyPath = "Software\MicrosoftWindows
sValueName = "Settings"
oReg.SetBinaryValue HKCU, sKeyPath, sValueName, aValueData
But I'm not the best with WMI stuff :-)
ASKER
it really looks fancy, but i just want to add the registry add to my current script.
tnx
tnx
Understood,
So as I've said, I would just do something like:
Set WSHShell.Run ("%windir%\regedit.exe /s myfile.reg")
If you want the registry edit itself to be part of the script, just write it out to the temp directory using the FileSystem Object first and then run the WSHSell.Run ...
Hope this helps,
Brad D.
So as I've said, I would just do something like:
Set WSHShell.Run ("%windir%\regedit.exe /s myfile.reg")
If you want the registry edit itself to be part of the script, just write it out to the temp directory using the FileSystem Object first and then run the WSHSell.Run ...
Hope this helps,
Brad D.
ASKER
Is there no way to include this registry add without redirecting to the reg file?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
ok, tnx.
I see them as a 2nd choice.
I cant understand why there is no way to include hexadecimal into vbs
I see them as a 2nd choice.
I cant understand why there is no way to include hexadecimal into vbs
Neither can I, for some reason they imposed a 4 byte limit. I guess it needed to be released on a certain date even if all the features weren't fully implemented?
ASKER
Is there no trick to fix it?
Not that I know of, perhaps there is (or will be) a new release of VBScript without the limitation.
Wish I could say more
Wish I could say more
ASKER
WSHShell.RegWrite "HKEY_CURRENT_USER\Softwar