Deploying an application and running a vbs before installation

(imported topic written by FITZPAW91)

Hi all

I am trying to deploy an application via the Software Distribution Wizard, but before it runs, I want to run a VBS that is downloaded along with the application that will change one setting in a config file to show current computers name. I can’t get this to work.

Any help would be appreciated.

extract 4.6.5.5120.0.tmp

waithidden wscript /e:vbs replace.vbs Nom_du_Serveur “WE %COMPUTERNAME%” Arcsight_SilentInstallation_Windows2003

wait __Download\ArcSight-4.6.5.5120.0-Connector-Win.exe -i silent -f “C:\Program Files\BigFix Enterprise\BES Client__BESData\CustomSite_LQ_Home_Made__Download\Arcsight_SilentInstallation_Windows2003”

(imported comment written by arnaud91)

Hi Fitzpaw,

You could try to replace “WE %COMPUTERNAME” with “WE {computer name}” in the wscript command line.

Arnaud.

(imported comment written by BenKus)

You should check which folder the vbscript ends up in (which would depend on which folder it was in when it was packaged). It probably is in the __Download folder:

waithidden wscript /e:vbs __Download\replace.vbs …

Ben

(imported comment written by FITZPAW91)

Thanks again, it seems to work

Now what I want to do is to create a value that is taken from a registry key (Computer Description) HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\srvcomment and insert it into the extracted text file before the application runs. I have created a custom property for this, but I am unsure of how to use it.

I have a vbscript that allows me to use arguments e.g. replace.vbs arg1 arg2 textfile.

Help please.

Thanks

William

(imported comment written by arnaud91)

Hi Fitzpaw,

So that other forum users can use it, could you precise what solved your problem and the syntax that finally worked?

To use the value of a registry key in your command line, write the relevance whitin curly brackets {}:

{value “srvcomment” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters” of registry}

According to your command line syntax, that will give something like:

replace.vbs arg1 {value “srvcomment” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters” of registry} textfile

Warning: if the value srvcomment doesn’t exist in the registry, the action will fail. You can add some checking before running the command line.

Arnaud

(imported comment written by FITZPAW91)

Hi Arnaud

This is the syntax that worked,

waithidden wscript /e:vbs __Download\replace.vbs Nom_du_Serveur {Computer Name} __Download\Arcsight_SilentInstallation_Windows2003

run __Download\ArcSight-4.6.5.5120.0-Connector-Win.exe -i silent -f “C:\Program Files\BigFix Enterprise\BES Client__BESData\CustomSite_LQ_Home_Made__Download\Arcsight_SilentInstallation_Windows2003”

William

(imported comment written by FITZPAW91)

Hi again,

Your syntax works as long as there are no spaces in the Computer Description. How should it look if there are spaces in the Computer Description…

replace.vbs arg1 {value “srvcomment” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters” of registry} textfile

William

(imported comment written by FITZPAW91)

Hi Again again

All I needed was quotes around the curly brackets

replace.vbs arg1 “{value “srvcomment” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters” of registry}” textfile

Thanks for all the help

(imported comment written by arnaud91)

Fitzpaw,

You’re right, you need quotes around the curly brackets.

Arnaud.