Action parameter query - vbs script

Halo,

I’m new to BigFix action script so I have a problem to run below script

cscript “C:\temp\ky\scripts\Prnport.vbs” -a -r MyQ_10.250.1.1 -h 10.250.1.1 -o raw -n 9100

with option that users can change numbers with action parameter query command.

So I found some on the net but with no luck.

My script:

action parameter query “Port” with description "Name of printer port "

action parameter query “IP” with description “IP address”

waithidden cscript.exe C:\temp\ky\scripts\Prnport.vbs -a -r ((parameter “Port” of action) as string)} -h ((parameter “IP” of action) as string)} -o raw -n 9100

In the console it say “Completed” but nothing happens on the target.

In log
At 11:51:24 +0200 - actionsite
Command succeeded action parameter query “Port” with description “Name of printer port” (action:130873)
Command succeeded action parameter query “IP” with description “IP address” (action:130873)
Command started - waithidden cscript.exe C:\temp\ky\scripts\Prnport.vbs -a -r ((parameter “Port” of action) as string)} -h ((parameter “IP” of action) as string)} -o raw -n 9100 (action:130873)
At 11:51:24 +0200 -
Report posted successfully
At 11:51:24 +0200 - actionsite
Command succeeded (Exit Code=1) waithidden cscript.exe C:\temp\ky\scripts\Prnport.vbs -a -r ((parameter “Port” of action) as string)} -h ((parameter “IP” of action) as string)} -o raw -n 9100 (action:130873)
At 11:51:24 +0200 -
GatherHashMV command received.
Processing fixlet site.
ActionLogMessage: (action:130873) ending action
At 11:51:24 +0200 - mailboxsite
Not Relevant - VBS_MyQ_printer_port (fixlet:130873)

Please help as to solve this issue.

Thanks in advance.

Hi ,

Use the following command :

waithidden cscript.exe C:\temp\ky\scripts\Prnport.vbs -a -r {parameter “Port”} -h {parameter “IP”} -o raw -n 9100

swap041 has the correct syntax on the waithidden command.
Be advised also that as BigFix client is a 32-bit application, by default it will run the 32-bit version of cscript.exe which frequently does not behave as you’d expect.
You can disable the 32-bit redirection by adding

action uses wow64 redirection false
anywhere in the action before running the waithidden command.

1 Like

I tried but this show in log

STATUS: Running action…
Command succeeded action parameter query “Port” with description “Name of printer port”
Command succeeded action parameter query “IP” with description “IP address”
Command failed (Relevance substitution failed) waithidden cscript.exe C:\temp\ky\scripts\Prnport.vbs -a -r {parameter “Port”} -h {parameter “IP”} -o raw -n 9100
Command failed (Relevance clauses must be surrounded by { and } guards.) waithidden cscript.exe C:\temp\ky\scripts\Prnport.vbs -a -r {parameter “Port”} -h {parameter “IP”} -o raw -n 9100

— Result —
Evaluation failed!