/build/static/layout/Breadcrumb_cap_w.png

Problems with VBS

Hi,

I've got a little problem with a script stored in a CA which should create some ActiveSetup regkeys.

For testing purposes I've set a MsgBox at the top of the script to ensure that Windows Installer is entering it and so
far it is working. The mistake must be somewhere in the first three lines because as soon as i click away my error
message i get MSI error 1720. My secound MsgBox after "Set StdOut = WScript.StdOut" isn't displayed.

Someone has an idea where the problem could be?

Greetings


const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
strValueName = "(Default)"
strValue = "blahblahblah"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
strValueName = "StubPath"
strValue = "%windir%\system32\cmd.exe /c "asdfasdf"
oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strKeyPath = "SOFTWARE\Microsoft\Active Setup\Installed Components\{0463bb93-634e-453c-a69b-09776a50d422}"
strValueName = "Version"
strValue = "1,0,0,0"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

0 Comments   [ + ] Show comments

Answers (3)

Posted by: captain_planet 13 years ago
Black Belt
0
This line looks wrong:
strValue = "%windir%\system32\cmd.exe /c "asdfasdf"
It should probably be:
strValue = "%windir%\system32\cmd.exe /c " & chr(34) & "asdfasdf" & chr(34)
Posted by: captain_planet 13 years ago
Black Belt
0
...and considering 'Set StdOut = WScript.StdOut' does nothing, remove it. [;)]
Posted by: Teitan 13 years ago
Senior Purple Belt
0
Already found the problem by myself :)
The line Set StdOut = WScript.StdOut caused the error.

Thank you!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ