Using the "script" action script command

(imported topic written by tigger0191)

Hello,

My action script looks like this:

download http://bigfix.mycompany.org:52311/Uploads/fe868bba074fa393521fb9d1ce1dc76fb7eb0d62/CSPUninstNoRebootvbs.tmp

continue if {(size of it = 943 AND sha1 of it = “fe868bba074fa393521fb9d1ce1dc76fb7eb0d62”) of file “CSPUninstNoRebootvbs.tmp” of folder “__Download”}

extract CSPUninstNoRebootvbs.tmp

script “{((pathname of client folder of current site) & “__Download\CSPUninstNoReboot.vbs”)}”

// pause while {exists running application “c:\windows\system32\msiexec.exe”}

My result in the log is this:

Command succeeded script "C:\Program Files (x86)\BigFix Enterprise\BES Cl

__BESData\opsite399__Download\CSPUninstNoReboot.vbs" (fixlet 182511)

BUT - I get a Windows Script Host GUI error dialogue that says "There is no extension in “C:\Program”.

In the bigger picture, what I’m trying to do is uninstall an old version of Symantec Critical System Protection and install a new version with a reboot after each, using tasks in a baseline. The part above is the uninstall task, which works when using appendfile to build a .bat to run my .vbs (see action script below), except for the timing. When I do it this way, the task does not wait until the uninstall is complete before doing the next task in the baseline (a reboot). You can see a commented out “pause while”. I was trying to use msiexec.exe in a pause while, but sometimes that process does not exit even though the uninstall completes successfully. I went to trying out the “script” command after discovering it in the action guide.

delete __appendfile

delete rununinstall.bat

appendfile @echo off

appendfile cd “{((pathname of client folder of current site)& “__Download”)}”

appendfile cscript.exe //B //Nologo CSPUninstNoReboot.vbs

appendfile :EOF

move __appendfile rununinstall.bat

waithidden rununinstall.bat

Any ideas on how to make this work?

(imported comment written by Lee Wei)

Sorry that I did not specifically test the statements for you.

But you can trying calling the Windows csript/wscript program directly.

wait “{pathname of system folder}\cscript.exe” “{((pathname of client folder of current site) & “__Download\CSPUninstNoReboot.vbs”)}”

I assume that your substitution parameter is expanding nicely with double quotes around the pathname+script name.

Lee Wei

(imported comment written by tigger0191)

Thanks, Lee Wei. This does a nice job of calling the script (not using appendfile to build a batch file is a step in the right direction). However, I still have the flow control issue whereby the action script continues before the uninstall is complete. How do I get the action script to wait until the uninstall is complete before continuing?

Using pause while against the msiexec.exe doesn’t work because msiexec.exe stays running after the uninstall is complete. Any suggestions you might have would be welcome. Thanks for the help.

(imported comment written by Branden_Wood91)

Hi Tigger01,

You could modify your batch script to wait for a file to be deleted before continuing. It would look something like this. (replace c:\test.txt, with whatever you are deleting)

delete __appendfile

delete rununinstall.bat

appendfile @echo off

appendfile cd “{((pathname of client folder of current site)& “__Download”)}”

appendfile cscript.exe //B //Nologo CSPUninstNoReboot.vbs

appendfile :evaluate

appendfile IF EXIST “c:\test.txt” (

appendfile @ping 127.0.0.1 -n 2 -w 1000 > nul

appendfile @ping 127.0.0.1 -n %1% -w 1000> nul

appendfile GOTO evaluate

appendfile ) ELSE (

appendfile GOTO next_step

appendfile )

appendfile :next_step

appendfile rem put your next step here

move __appendfile rununinstall.bat

waithidden rununinstall.bat

Good luck

(imported comment written by tigger0191)

I’ve made a little progress on this. I was able to do a pause while {exists service “sisipsservice”} which gave enough time for the uninstallation to complete. This solution may or may not be ideal, as I do not know the order of operations for the uninstall; i.e., I don’t know what happens last. It appears to be working in this instance. If you have a better way of accomplishing this task, I’d love to hear it. Again, thanks for the help.

(imported comment written by Branden_Wood91)

I believe the ideal solution would be to port your vbscript to BigFix Action Script, from there we should be able to accomplish everything you need.

(imported comment written by tigger0191)

Thanks, Branden. I got the text of your work around. I’ll be looking it over this afternoon. I’ll reach back out as needed.

Again, thanks.