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  
  •  How do I search recursively for a string and replace all instances of it with another in Linux?
  •  Enable 'Client for Microsoft Networks' & 'File and Printer Sharing for Microsoft Networks' via group policy
  •  ACCESS 2007: Transfer information from one table to multiple tables depending on the ID
  •  Microsoft, Exchange Server, 2007, setup cannot verify that the Host "A" record for this computer exists within the DNS database located on server (The Server IP address)
  •  SqlClient Data Provider too many processes per user
  •  Remove leading characters in a string, convert to integer, add, convert back to string
  •  DTS transformation error with vb script
  •  Combine log files into one file?
  •  Disable taking ownership of hosts file
  •  MySQL Left Join Query with only the most recent value from second table
  •  
    programming4us programming4us