Install package (SCCM) using batch file fails; event id 10006, exit code 1

DavidfromRedondo 1 Reputation point
2022-02-23T01:50:06.453+00:00

I am using a simple script (a batch file) to install software (Cisco AMP Endpoints Connector). The script works when I run it manually (the software installs), but when I create an install package in Endpoint Config Manager (SCCM) to use that script, I get “program failed, message ID 10006." This is what I see when I run a report in SCCM. The package seems to be accepted by each computer in the collection. On each target PC, I can see that the .exe and the script get saved to the CCMcache folder (in C:\Windows). This means SCCM is successfully copying it to each PC in the collection (I choose option for target PCs to download from the distribution point). However, it fails to install.

When I check execmgr.log on one of the target computers, it says package "failed with exit code 1."

The script in the batch file is:

START ampauditwithTrend /R /S /desktopicon 0 /startmenu 1 /contextmenu 1

Ampauditwithtrend is an .exe. The switches used are native to the Cisco installer program. Again, the script works when run manually (the software installs silently and unattended). I just need to install it on almost 400 PCs. I made sure that the package runs with administrative rights and whether or not a user is logged on. Also, SCCM has permission to the shared folder where the batch file and the .exe install file are located.

Why is the package failing? What I am I doing wrong? Has anyone seen this before? Do I need to add something to the script in order for SCCM process the install instruction? I would think that if the script works when I run it manually, then it should work in the package.

Thank you in advance.

David

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
488 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jason Sandys 31,296 Reputation points Microsoft Employee
    2022-02-24T16:46:17.753+00:00

    Multiple comments here:

    • There's no reason to use START, EXEs are native formats that Windows knows how to launch. START is used to modify how Windows launches an EXE when you need to modify this (I've never found a valid reason to do this in ConfigMgr). This isn't the source of your issue, but still can contribute to confusion and other issues.
    • Also not your issue, but there's no reason to use a batch file for a single command-line. Just use that command-line directly in your program.
    • That exit code is from the command line that you are running which in turn is coming from the EXE called in your batch file. What that means is up to the developer of the EXE and it may or may not conform to standard Windows/Win32 error codes. It's not common, but some developers use an exit code of 1 as a success -- as noted, this is non-standard and up to the developer, not ConfigMgr, Windows, or Microsoft. Thus, you need to troubleshoot why this EXE is returning the exit code which may involve telling the EXE to create a log file (which is also something the developer defines) or consult the developer's documentation.
    1 person found this answer helpful.
    0 comments No comments

  2. DavidfromRedondo 1 Reputation point
    2022-02-24T19:02:02.493+00:00

    @Jason Sandys
    I got it to work by using the Command Line field in the program settings (like you said). I am used to using MSIExec scripts to install software (via Config Manager), so I forgot to go back to basics (and not use a script file at all).

    Thanks!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.