Apologies folks, I’m sure this is an easy one but having difficulty getting this to work correctly.
I’ve got a batch file that I’m using to remove software on some clients. I’ve packaged it through the Windows Software Deployment Wizard, which uploads the batch file to the server then downloads to the clients and executes. The batch file does its job perfectly when I run it on the client from the __Download folder. However, when I attempt to have it executed through BigFix it never runs (the action script does complete, but the batch file doesn’t appear to run as the software never uninstalls).
I’ve tried running as:
run __Download\remove.bat
dos __Download\remove.bat
wait __Download\remove.bat
…with no success. What am I missing here? Thanks in advance for assistance!
Hmmm…if so, then I’m out of luck. I’m trying to remove software from servers. I see that you can use the RunAsCurrentUser executable from: http://forum.bigfix.com/viewtopic.php?id=74, but as they are servers and shouldn’t have a current user for the most part, it won’t work. Ben / Tyler, ideas?
When I am having problems getting a bat file to work as an action, I usually translate what is going on in the bat file into action script. It makes it easier to see what is failing and where.
Can you edit your batch file to remove any potentially confidential information and post it here?
I would convert this entirely to a BES action script. You’ll get much better performance, and I suspect the source of your issue is the inability to access the network share using the SYSTEM account. You could solve this by making your shares ‘null sessions shares’, but I think you’ll find it easier to just make an action script that does the whole thing.
You’ll need to get the .iss file onto the bes server. You can do this via the upload wizard, or by caching it manually in the wwwroot directory. If you use the upload wizard it has the nice effect of creating the ‘continue if’ statement for you with the correct size and sha1. Assuming you use the upload wizard, modify the generated action to execute your command. In the end it will look something like this:
download http:
//ourbigfixserver.com:<port#>/Uploads/sha1abcdefghijklmsha1/big1BF.tmp
continue
if
{ (size of it = 219 and sha1 of it =
"sha1abcdefghijklmsha1") of file
"big1BF.tmp" of folder
"__Download"
} extract big1BF.tmp wait
"C:\Program Files\InstallShield Installation information\{{DCD3461A-7AA6-44D3-9DC2-FE7B28DC7189}\setup.exe" -s -f1
"{pathname of client folder of current site}\__Download\uninstall.iss"
Note the double {{ . Curly braces are a reserved character in the action script to denote the start of a relevance expression. You need to escape the left brace by adding a second left brace so that the client will not try to interpert the GUID as a relevance expression.
That was the fix! Looks like I just needed to add the extra curly bracket, because I tried all the other possibilities for the command statement. I also made sure that the action downloaded the uninstall.iss file to the local __Download folder.