Software Deploy Task to run a bat file

(imported topic written by ppomeroy91)

I’m trying to create a Software Deploy Task to run a bat file. It is “almost” complete. You guys can probably tell me right away what I have wrong. Here’s the Command in the Task:

download http://bigfixsvr.BurstHQ.burstmedia.local:52311/Uploads/3ab08e00e7f2761e09602ccd0fcc8292bae359d4/App.tmp

continue if {(size of it = 605830 AND sha1 of it = “3ab08e00e7f2761e09602ccd0fcc8292bae359d4”) of file “App.tmp” of folder “__Download”}

extract App.tmp

wait cmd.exe /C “{{(pathname of client folder of current site) _Download\RunCleanWipe.bat”}

Here’s the log file. It appears to be successful and the Action reports Completed however it is not actually “running” the bat file and doing what it’s supposed to (remove the software). The files ARE being downloaded.

At 10:32:42 -0500 -

SetupListener completed successfully

At 10:32:45 -0500 -

User interface process started for user ‘administrator’

At 10:33:44 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Relevant - Software Distribution - Deploy: SCSCleanWipe-3 (fixlet:249)

At 10:33:44 -0500 -

ActionLogMessage: (action 249 ) Action signature verified

ActionLogMessage: (action 249 ) Non-Distributed - DownloadsAvailable

ActionLogMessage: (action 249 ) starting action

At 10:33:44 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Using download manager collected file) download http://bigfixsvr.BurstHQ.burstmedia.local:52311/Uploads/3ab08e00e7f2761e09602ccd0fcc8292bae359d4/App.tmp (fixlet 249)

At 10:33:45 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (evaluated true) continue if {(size of it = 605830 AND sha1 of it = “3ab08e00e7f2761e09602ccd0fcc8292bae359d4”) of file “App.tmp” of folder “__Download”} (fixlet 249)

At 10:33:46 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded extract App.tmp (fixlet 249)

At 10:34:31 -0500 -

Report posted successfully.

At 10:34:32 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Exit Code=1) wait cmd.exe /C “{(pathname of client folder of current site) _Download\RunCleanWipe.bat”} (fixlet 249)

At 10:34:33 -0500 -

ActionLogMessage: (action 249 ) ending action

At 10:34:33 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Not Relevant - Software Distribution - Deploy: SCSCleanWipe-3 (fixlet:249)

At 10:40:20 -0500 -

ForceRefresh command received. Version difference, gathering action site.

(imported comment written by jessewk)

You have an syntax errors in your relevance substitution. Try this:

wait cmd.exe /C “{(pathname of client folder of current site)}__Download\RunCleanWipe.bat”

You also probably want to use waithidden instead of wait

(imported comment written by ppomeroy91)

Still getting the same message, Not Relevant - Software Distribution

At 15:50:30 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Using download manager collected file) download http://bigfixsvr.BurstHQ.burstmedia.local:52311/Uploads/69189cb06c75a2ebddc6a4f7861ab2cb4263b85a/SCSCleanWipe.tmp (fixlet 263)

Command succeeded (evaluated true) continue if {(size of it = 790783 AND sha1 of it = “69189cb06c75a2ebddc6a4f7861ab2cb4263b85a”) of file “SCSCleanWipe.tmp” of folder “__Download”} (fixlet 263)

Command succeeded extract SCSCleanWipe.tmp (fixlet 263)

At 15:50:31 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Exit Code=1) waithidden cmd.exe /C “{(pathname of client folder of current site)}__Download\SCS_CleanWipe.bat” (fixlet 263)

At 15:50:31 -0500 -

ActionLogMessage: (action 263 ) ending action

At 15:50:31 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Not Relevant - Software Distribution - Deploy: SCSCleanWipe-5 (fixlet:263)

(imported comment written by ppomeroy91)

let me add, it’s downloading the files and says Command Succeeded but it’s not running the bat file.

(imported comment written by BenKus)

Did you remove the dual “{{”? Your logs seem to indicate that it might still be there… And note that it returns “command succeeded” because it was able to execute cmd.exe, but that doesn’t necessarily indicate the batch file worked…

You might try with the relative path for simplicity:

waithidden cmd.exe /C “__Download\SCS_CleanWipe.bat”

If that doesn’t work, can you please post the contents of the .bat file (if it is using relative file paths, that could be an issue)…

Ben

(imported comment written by ppomeroy91)

Hi, thank you for your help.

Here’s the log file. The bat file is relatively simple and came from Symantec.

At 08:37:03 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Relevant - Software Distribution - Deploy: SCSCleanWipe-4 (fixlet:265)

At 08:37:03 -0500 -

ActionLogMessage: (action 265 ) Action signature verified

ActionLogMessage: (action 265 ) Non-Distributed - DownloadsAvailable

ActionLogMessage: (action 265 ) starting action

At 08:37:06 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Using download manager collected file) download http://bigfixsvr.BurstHQ.burstmedia.local:52311/Uploads/0665c4ac11d0b46f842104937e3b2423cbaff7f3/SCSCleanWipe.tmp (fixlet 265)

Command succeeded (evaluated true) continue if {(size of it = 790785 AND sha1 of it = “0665c4ac11d0b46f842104937e3b2423cbaff7f3”) of file “SCSCleanWipe.tmp” of folder “__Download”} (fixlet 265)

At 08:37:07 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded extract SCSCleanWipe.tmp (fixlet 265)

At 08:37:10 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Exit Code=1) waithidden cmd.exe /C “__Download\SCS_CleanWipe.bat” (fixlet 265)

At 08:37:12 -0500 -

ActionLogMessage: (action 265 ) ending action

At 08:37:12 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Not Relevant - Software Distribution - Deploy: SCSCleanWipe-4 (fixlet:265)

(imported comment written by ppomeroy91)

Here’s the bat file that it calls as well.

(imported comment written by ppomeroy91)

I don’t understand the below message.

Not Relevant - Software Distribution - Deploy: SCSCleanWipe-5

How can it be not relevant when I’m targeting ALL computers?

(imported comment written by BenKus)

It looks like your batch file uses relative paths, which is probably the problem that you are seeing…

Add:

cd __Download

as the first line in SCS_CleanWipe.bat and hopefully that fixes it…

Ben

(imported comment written by ppomeroy91)

That was still unsuccessful. I’m not trying to skip the initial SCS_CleanWipe and go right for the RunCleanWipe.bat file. Again, it is downloading but it’s not running the bat file. I can successfully run the bat file from the download location by hand. Here’s the client log and attached is the bat file.

At 13:55:39 -0500 -

Gather merging new file C:\Program Files\BigFix Enterprise\BES Client__BESData\actionsite\Action 324.fxf

At 13:55:39 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Successful Synchronization with FixSite (version 656) - ‘http://BIGFIXSVR.BurstHQ.burstmedia.local:52311/cgi-bin/bfenterprise/BESGatherMirror.exe?url=http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite

At 13:55:41 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Relevant - Software Distribution - Deploy: RunCleanWipe-1 (fixlet:324)

At 13:55:41 -0500 -

ActionLogMessage: (action 324 ) Action signature verified

ActionLogMessage: (action 324 ) Non-Distributed - DownloadsAvailable

ActionLogMessage: (action 324 ) starting action

At 13:55:42 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded (Using download manager collected file) download http://bigfixsvr.BurstHQ.burstmedia.local:52311/Uploads/cb26b8d25cf37a0ae04d835e9931f30569e4f31f/App.tmp (fixlet 324)

Command succeeded (evaluated true) continue if {(size of it = 605893 AND sha1 of it = “cb26b8d25cf37a0ae04d835e9931f30569e4f31f”) of file “App.tmp” of folder “__Download”} (fixlet 324)

At 13:55:43 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Command succeeded extract App.tmp (fixlet 324)

Command succeeded (Exit Code=1) wait cmd.exe /C “{(pathname of client folder of current site) & “__Download\RunCleanWipe.bat”}” (fixlet 324)

At 13:55:44 -0500 -

ActionLogMessage: (action 324 ) ending action

At 13:55:44 -0500 - actionsite (http://bigfixsvr.BurstHQ.burstmedia.local:52311/cgi-bin/bfgather.exe/actionsite)

Not Relevant - Software Distribution - Deploy: RunCleanWipe-1 (fixlet:324)

At 13:56:04 -0500 -

ForceRefresh command received. Version difference, gathering action site.