Script Won't Run

Hi,

I have a software install package that is triggered by a batch script. I use the wizard to upload the package to the IEM server and adjusted the action to use the script instead of the program’s executable. The task fails, though the sequence shows each step completing successfully. The software does not get installed on the target computer. This is what I have for the action part:

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

The log file shows everything as succeeding, yet the software does not install. When run interactively, the batch file kicks off a whole bunch of activities that install the software and supporting files. In order to run this batch file successfully, one needs to do it from and administrative command prompt. Does the IEM client have that level of access?

Command succeeded extract ca47cbe7c11f27fac68dcb8e8cf9ece761295ad0 (action:92573)
Command started - wait “C:\Windows\system32\cmd.exe” /C “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\opsite112__Download\installer.bat” (action:92573)
At 22:40:47 -0400 - actionsite (http://iem.domain.com:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded (Exit Code=0) wait “C:\Windows\system32\cmd.exe” /C “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\opsite112__Download\installer.bat” (action:92573)

Thanks in advance

Jason

The Client on Windows runs as Local SYSTEM, and so does typically have ‘Administrative’ access, yes, but at the same time, its user context is different (which can sometimes be a factor if the installer/batch script is expecting a user rather than the SYSTEM account).

You can test whether or not this is a potential factor by attempting to run the batch script interactively under the SYSTEM context. The following link describes how to perform such a test:

http://www-01.ibm.com/support/docview.wss?uid=swg21505733

1 Like

I think your issue is that you are missing a \

This actionscript / relevance substitution is easier, and should solve the problem:

wait "{pathname of system folder & "\cmd.exe"}" /C "{ pathname of download file "installer.bat" }"

I tried the action you posted and it still didn’t work. Same as before, all of the steps ran, but the software did not install and the deployment failed.

Log entries:

At 21:31:25 -0400 - actionsite (http://iem.domain.com:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded (Prefetch download manager collected file) prefetch ca47cbe7c11f27fac68dcb8e8cf9ece761295ad0 sha1:ca47cbe7c11f27fac68dcb8e8cf9ece761295ad0 size:281390976 http://iem.domain.com:52311/Uploads/ca47cbe7c11f27fac68dcb8e8cf9ece761295ad0/LoggerPro39.tmp (action:93496)
At 21:31:28 -0400 - actionsite (http://iem.domain.com:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded extract ca47cbe7c11f27fac68dcb8e8cf9ece761295ad0 (action:93496)
Command started - wait “C:\windows\system32\cmd.exe” /C “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\opsite112__Download\installer.bat” (action:93496)
At 21:31:29 -0400 - actionsite (http://iem.domain.com:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded (Exit Code=0) wait “C:\windows\system32\cmd.exe” /C “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\opsite112__Download\installer.bat” (action:93496)
At 21:31:29 -0400 -
ActionLogMessage: (action:93496) ending action

I see my confusion now. You were not missing the \ like I thought. Your log details were not wrapped in a pre-formatted block so it screwed with what I could see.

What is the contents of the BAT file?

The batch file runs several commands to uninstall/install Logger Pro 3

@echo off

REM Uninstall any previous version(s) of Logger Pro 3 older than v. 3.8.3
.\LP383_and_earlier_Uninstall.exe /s /Z"SILENT"

REM Uninstall the Uninstaller, silently
.\LP383_and_earlier_Uninstall.exe /s /uninst

REM Uninstall Vernier Experiments subinstaller (if it exists on the system)
msiexec /qn /x{C6586FE3-7DBE-4F71-BA8A-A4998F6F0A96}

REM Install the MSVC redistributable for Bluetooth radio
vcredist_x86.exe /q

REM This is the silent installer for Vernier Logger Pro software
msiexec /i “Logger Pro 3.msi” /qn /L*v %TEMP%\LoggerPro3_msilog.txt

REM This is the silent installer for Vernier Logger Pro software including the DataShare install
REM msiexec /i “Logger Pro 3.msi” INSTALLDATASHARE=“INSTALL” /qn /L*v %TEMP%\LoggerPro3_msilog.txt

Could it be a working directory issue?

Normally the first line of the batch file is: cd “{parameter “baseFolder”}”

That puts the working directory into the download folder.

Could you try adding:
cd “{parameter “baseFolder”}”

to the first line of your batch file? Also make sure that:
parameter “baseFolder” = “__Download/”

Is somewhere above where you write the batch file

1 Like

I agree with @strawgate that this seems to be an issue of using relative paths from the wrong working directory.

I typically use relevance to give me the absolute paths dynamically, as that is often needed when referring to a file in a parameter in another command. Definitely don’t hard code absolute paths.

@strawgate 's suggestion might be the best option to try.

You could also have the BAT file output to a file to see what shows up there.

personally I avoid using BAT files and prefer just to have each line that would be in the BAT file it’s own “wait” line in the actionscript because then the system provides much better feedback as far as what worked and what didn’t.

What seems to be happening right now in this current case is the BAT file is being found and executed successfully, but the contents of the BAT file are failing, but BigFix isn’t aware of that, so it doesn’t provide any feedback to indicate that.

1 Like

I’ll try to do this another way, without the batch file. Thanks