Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SCCM ERROR!!!!!!!!!!!!

Posted on 2011-05-12
5
Medium Priority
?
2,094 Views
Last Modified: 2012-05-11
I am simply trying to run a batch file as a program within a package and advertise that to some systems. The batch file is supposed to uninstall an older application and then install the newer one using its .msi package. I try to do this and I get the following error every time under the Advertisement System Status location in SCCM:

============================================================================
A failure exit code of 1 was returned.
User context: NT AUTHORITY\SYSTEM

Possible cause: Systems Management Server (SMS) determines status for each program it executes. If SMS cannot find or correlate any installation status Management Information Format (MIF) files for the program, it uses the program's exit code to determine status. An exit code of 1 is considered a failure.
Solution: For more information on the exit code, refer to the documentation for the program you are distributing.
=============================================================================

Also, here is the code I am trying to use in my batch file:
REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\FFD0D1F8C889BA64A87750A079B96B05\InstallProperties /v DisplayVersion | Find "DisplayVersion      REG_SZ  7.5.087"

If %ErrorLevel%==0 goto Exist

If %ErrorLevel%==1 goto Not_Exist

:Exist

msiexec.exe /x "\\myUNClocation\old.msi" /qn

msiexec.exe /i "\\myUNClocation\new.msi" /qn /norestart

:Not_Exist

Exit

Open in new window

0
Comment
Question by:kulisncc
  • 3
5 Comments
 
LVL 31

Accepted Solution

by:
merowinger earned 2000 total points
ID: 35752194
1. Uninstall the Application with the Windows Installater Product GUID and not the Filename
msiexec.exe /x "{XYZ.....}" /qn

2. Copy the batch file and the new.msi into the new package and then start the batuch in the program paramaters with the following command:
cmd /v yourbatch.bat
and tht installation of the msi wit the following command
msiexec.exe /i new.msi /qn /norestart
(As the msi is in the same path then you don't need to define it

Make sure the EXISTS section gets executed. For example create a Logfile with the following command
echo "yes its executed" > C:\did_run.txt
REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\FFD0D1F8C889BA64A87750A079B96B05\InstallProperties /v DisplayVersion | Find "DisplayVersion      REG_SZ  7.5.087"

If %ErrorLevel%==0 goto Exist

If %ErrorLevel%==1 goto Not_Exist

:Exist
echo "yes its executed" > C:\did_run.txt

msiexec.exe /x "{XYZ....}" /qn

msiexec.exe /i "new.msi" /qn /norestart

:Not_Exist

Exit

Open in new window

0
 

Author Comment

by:kulisncc
ID: 35756553
I will try that, but I have a question. Why is it that it uninstalls the program referencing the msi file when I run it manually? For instance, this actually works:

msiexec.exe /x "\\myUNClocation\old.msi" /qn

but you are saying that if running as a logon script then reference the programs GUID instead?
0
 

Author Comment

by:kulisncc
ID: 35756631
By the way, my data validation is running i already tested that before posting here (%errorlevel1%). Thanks though.
0
 

Author Comment

by:kulisncc
ID: 35758637
the uninstall works with the GUID, thanks
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question