Command Line Installation with SCCM 2012

0

I have a few applications that I am trying to deploy with SCCM 2012 but the installations are failing through the application catalog. So what I have for the deployment type is a script installer. I have "cmd.exe" (Without quotations) in the Installation program field and "Installer.bat" in the installation start in field.

When I look at the ccmcache folder, all the contents over that application are there but the following error displays the Software Center:

 0x8007010B(-217024629)

I have done some reading online and the "10B" is a common command line error for invalid directory. I have tested the batch file when hard coding a path but my question is, how can I edit the batch file or SCCM to pull from the CCMCache path where the files are downloaded to on the local client? Currently the Batch File is simply:

 @echo off
 ApplicationName.exe

Do I need to edit the file to cd into the CCMCache folder where the files are placed? How can I get the batch file to run the executable that is downloaded to the CCMCache folder?

Thank You!

batch-file
deployment
automation
windows-server-2008
sccm
asked on Stack Overflow Jun 28, 2018 by TXServerAnalyst

2 Answers

0

You need to have the full path to the installation in your script

@echo Off

\\path to .exe

The way the command is written will not be able to find the .exe file. You need to add the full unc path to the .exe into your .cmd file. You should have your installation .exe and .cmd file in the same location on the distribution share

answered on Stack Overflow Jul 16, 2018 by Joseph Martocchio
0

Recommended Solution:

Before starting, since you are only launching an exe with your batch file, I would recommend just using your ApplicationName.exe as your command line parameter in SCCM instead of using a batch. This will eliminate the need to engineer any further.

Modifying the existing solution to work:

If you do still want to use a batch file, keep a few things in mind. The syntax you are using to launch the batch file will not work. I would recommend just using the batch file name "installer.bat" as your command line. If you still want to preface the batch with the cmd.exe, you absolutely need to use the /c switch with it

cmd.exe /c installer.bat

If you don't use /c the console host will only open to a promopt and not execute your batch.

This is not an ideal solution though because using "cmd.exe /c" will set your working directory to the location of cmd.exe (ie "C:\windows\system32") and since your content is staged in ccmcache, you will need to specify its location within your batch. To do this, you would use %~dp0 variable which gives you the directory the current batch is running from. This means modifying your batch to read

@echo off
%~dp0ApplicationName.exe
answered on Stack Overflow Jul 19, 2018 by Paul G

User contributions licensed under CC BY-SA 3.0