BES Action Shell Command - Wait Failing

(imported topic written by KHaynes)

I’ve created a custom task which i intend to use to run a vbscript local to the target server. The script moves cluster resources to another node and will be the first component in a baseline used for applying security updates. I need the script to complete before patches are deployed to the server but cannot get the wait command to work. The task string is as follows;

wait “cscript %SystemDrive%\ENT\MoveClusterGroups\PrePatchMvClustGrp.vbs”

But the task fails with the following;

Command failed (Thread execution failed) wait “%SystemDrive%\ENT\MoveClusterGroups\PrePatchMvClustGrp.vbs”

However when i substitute wait for dos the command completes successfully. Is there a reason why i can’t use wait in this manner or is there something wrong with the action command i am trying to execute?

Regards,

Ken

(imported comment written by jessewk)

Hi Ken,

The reason is your environment variable %SystemDrive% . Environment variables are not expanded by the BigFix Client. The ‘DOS’ version of your action works because cscript will expand the environment variable after the argument string is passed into it.

If you would like to use the ‘wait’ syntax, you should use relevance to extract the system drive. Here are 2 example that should both work, but in slightly different ways.

wait “{value of variable “SystemDrive” of environment}\ENT\MoveClusterGroups\PrePatchMvClustGrp.vbs”

wait “{pathname of root folder of drive of system folder}\ENT\MoveClusterGroups\PrePatchMvClustGrp.vbs”

I prefer the second one because I find environment variables are frequently unreliable.

I know there are others out there who patch clusters using BigFix. Does anybody care to share their methodology?

(imported comment written by KHaynes)

Thanks for the reponse, i’ve tried both of the suggestions which both translate the path correctly but i still get the same error.

Command failed (Thread execution failed) wait “C:\ENT\MoveClusterGroups\PrePatchMvClustGrp.vbs” (fixlet 1900)

Regards,

Ken

(imported comment written by jessewk)

Hi Ken,

Try passing the vbscript through cscript.

wait “{pathname of system folder}\cscript.exe” “{pathname of root folder of drive of system folder}\ENT\MoveClusterGroups\PrePatchMvClustGrp.vbs”

(imported comment written by KHaynes)

Thanks, this works. I did try passing the vbscript through cscript but i hadn’t added the path statement.

Returning to the process i’m performing. I’ve had to create a Custom Task to execute this command at the start of a Baseline i’ve created, I would prefer to execute this command as a Pre or Post Action when deploying my patching Baseline but the commands don’t get saved in the Preset i’ve created is there a reason for this?