Question : Windows Scripting - Regwrite

Firstly i appologise if this is posted in the wrong topic area. I will also be posting it in VB.

How can u use Regwrite to register a shared DLL.

(i may be overlooking something blindingly obvious, I'm not a programer!)

Seems simple but the syntax appears to be
Myshell.regwrite "Registry key\Registry value", data, datatype

The problem being that registry Value is the path to the Dll hence it has a lot of "\"s which regwrite assumes are sub keys.

Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs\'C:\Program Files\xyz.dll'", 00000002, "REG_DWORD"

Answer : Windows Scripting - Regwrite

1. Make a .REG file. Then invoke the file through the script like this:
set o = CreateObject("WScript.Shell")
Return=o.run ("regedit /s Your_File.REG",1,true)

2. Or try puting a \ at the end:
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs\'C:\Program Files\xyz.dll'\",
00000002, "REG_DWORD"

Hope this helps.

Random Solutions  
 
programming4us programming4us