Folks,

Need some assistance, I'm writing a login script to install a piece of
software on PCs when people login. The softrware requires me to add registry
change to each machine so I have call the "regedit /s" command using the
vbscript. The problem is my script only creates the folders in the registry
but does not add any registry keys. If I run the command directly from
command prompt it works. Below is an example of the vbscript and registry
file, if anyone can help me out on this problem, much appreaciated.
vbscript

Set wshShell = CreateObject("WScript.Shell")
wshShell.Run("RegEdit /s" & "c:\pcmon.reg")

registry file
[HKEY_LOCAL_MACHINE\SOFTWARE\PCwatch\pcmon]
"LogFileDir"="\\\\MGMT-WATCH\\public$\\logfiles"
"ProdVer"="Focus"
"TCPIPServer"="MGMT-WATCH"
"UDPServer"="MGMT-WATCH"
"ConfigServer"="MGMT-WATCH"

thanks,
Liam Mac

Re: Vbscripting calling Regedit /s problem by indyboy

indyboy
Thu Dec 01 05:49:37 CST 2005

Try this
wshShell.Run("cmd /c" &" " & "RegEdit /s" & "c:\pcmon.reg")


Re: Vbscripting calling Regedit /s problem by LiamMac

LiamMac
Thu Dec 01 06:05:04 CST 2005

Try the below but still no joy, it only creates the folder in registry and
not the keys.
thanks,
liam mac

"indyboy" wrote:

> Try this
> wshShell.Run("cmd /c" &" " & "RegEdit /s" & "c:\pcmon.reg")
>
>

Re: Vbscripting calling Regedit /s problem by Tim

Tim
Thu Dec 01 07:19:15 CST 2005

Liam,

Make sure your registry file is flat text, (not unicode) and add
"REGEDIT4" as the first line of the file

--
tim

"Liam Mac" <LiamMac@discussions.microsoft.com> wrote in message
news:FEA2930A-17C5-4AA9-8639-F1F6358ADD02@microsoft.com...
> Folks,
>
> Need some assistance, I'm writing a login script to install a piece of
> software on PCs when people login. The softrware requires me to add
> registry
> change to each machine so I have call the "regedit /s" command using the
> vbscript. The problem is my script only creates the folders in the
> registry
> but does not add any registry keys. If I run the command directly from
> command prompt it works. Below is an example of the vbscript and registry
> file, if anyone can help me out on this problem, much appreaciated.
> vbscript
>
> Set wshShell = CreateObject("WScript.Shell")
> wshShell.Run("RegEdit /s" & "c:\pcmon.reg")
>
> registry file
> [HKEY_LOCAL_MACHINE\SOFTWARE\PCwatch\pcmon]
> "LogFileDir"="\\\\MGMT-WATCH\\public$\\logfiles"
> "ProdVer"="Focus"
> "TCPIPServer"="MGMT-WATCH"
> "UDPServer"="MGMT-WATCH"
> "ConfigServer"="MGMT-WATCH"
>
> thanks,
> Liam Mac
>



Re: Vbscripting calling Regedit /s problem by indyboy

indyboy
Thu Dec 01 07:28:03 CST 2005

I think you are missing the top line in your reg file. I would use the
REGEDIT4 one since it's backwards compatible with legacy OS machines.

********************************************************************
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\PCwatch\pcmon]
"LogFileDir"="\\\\MGMT-WATCH\\public$\\logfiles"
"ProdVer"="Focus"
"TCPIPServer"="MGMT-WATCH"
"UDPServer"="MGMT-WATCH"
"ConfigServer"="MGMT-WATCH"

-OR-

********************************************************************
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\PCwatch\pcmon]
"LogFileDir"="\\\\MGMT-WATCH\\public$\\logfiles"
"ProdVer"="Focus"
"TCPIPServer"="MGMT-WATCH"
"UDPServer"="MGMT-WATCH"
"ConfigServer"="MGMT-WATCH"


Re: Vbscripting calling Regedit /s problem by James

James
Thu Dec 01 09:26:50 CST 2005

"Liam Mac" <LiamMac@discussions.microsoft.com> wrote in message
news:FEA2930A-17C5-4AA9-8639-F1F6358ADD02@microsoft.com...
> Folks,
>
> Need some assistance, I'm writing a login script to install a piece of
> software on PCs when people login. The softrware requires me to add
registry
> change to each machine so I have call the "regedit /s" command using the
> vbscript. The problem is my script only creates the folders in the
registry
> but does not add any registry keys. If I run the command directly from
> command prompt it works. Below is an example of the vbscript and registry
> file, if anyone can help me out on this problem, much appreaciated.
> vbscript
>
> Set wshShell = CreateObject("WScript.Shell")
> wshShell.Run("RegEdit /s" & "c:\pcmon.reg")

It looks like you are just missing a space. Change you line to look like
this and give it a try:

wshShell.Run("RegEdit /s " & "c:\pcmon.reg")

I am a little curious as to why you are concatenating "RegEdit /s" &
"c:\pcmon.reg" since you are not using any variables. Why not just use?:

wshShell.Run("RegEdit /s c:\pcmon.reg")