Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING .Bat file not executing through sccm

  • Thread starter Thread starter Rohit
  • Start date Start date
  • Replies Replies 9
  • Views Views 9K

Rohit

Active Member
Messages
43
Reaction score
0
Points
6
I am trying to uninstall SCEP through sccm with .bat file. But i m getting bad environment error in execmgr.log file.

bat file command line

@echo off
C:\Windows\ccmsetup\scepinstall.exe /u /s


Below are the logs details.


Processing [{7F74737F-491E-4699-8D8B-43FC7A8CF595}, 0]: OnContentAvailable execmgr 10/10/2019 5:10:57 PM 6036 (0x1794)
[{7F74737F-491E-4699-8D8B-43FC7A8CF595}]: Content Version 3 is available for advert HGC20016, pkg: HGC00031, program SCEP Uninstall. execmgr 10/10/2019 5:10:57 PM 6036 (0x1794)
An existing MTC token was not supplied, using ExecutionRequest's Id as MTC token and this execution request is the owner of resultant MTC task. execmgr 10/10/2019 5:10:57 PM 6036 (0x1794)
Request a MTC task for execution request of package HGC00031, program SCEP Uninstall with request id: {AAA735E9-906A-4EEA-A775-A8764CE2931D} execmgr 10/10/2019 5:10:57 PM 6036 (0x1794)
Execution Request for advert HGC20016 package HGC00031 program SCEP Uninstall state change from WaitingContent to Ready execmgr 10/10/2019 5:10:59 PM 6036 (0x1794)
MTC task with id {AAA735E9-906A-4EEA-A775-A8764CE2931D}, changed state from 0 to 4 execmgr 10/10/2019 5:10:59 PM 4116 (0x1014)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HGC00031",ProgramID="SCEP Uninstall", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 10/10/2019 5:10:59 PM 6036 (0x1794)
Processing [{7F74737F-491E-4699-8D8B-43FC7A8CF595}, 0]: RemoveNotification execmgr 10/10/2019 5:10:59 PM 6036 (0x1794)
MTC signaled SWD execution request with program id: SCEP Uninstall, package id: HGC00031 for execution. execmgr 10/10/2019 5:10:59 PM 4116 (0x1014)
Sending ack to MTC for task with id: {AAA735E9-906A-4EEA-A775-A8764CE2931D} execmgr 10/10/2019 5:10:59 PM 4116 (0x1014)
Executing program "Uninstall MEP.bat" in Admin context execmgr 10/10/2019 5:10:59 PM 4116 (0x1014)
Execution Request for advert HGC20016 package HGC00031 program SCEP Uninstall state change from Ready to NotifyExecution execmgr 10/10/2019 5:10:59 PM 4116 (0x1014)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HGC00031",ProgramID="SCEP Uninstall", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 10/10/2019 5:10:59 PM 4116 (0x1014)
Checking content location C:\Windows\ccmcache\4 for use execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Successfully selected content location C:\Windows\ccmcache\4 execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Executing program as a script execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Invalid executable file "Uninstall MEP.bat" execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramBadEnvironmentEvent
{
AdvertisementId = "HGC20016";
ClientID = "GUID:EC8E73DC-C143-408D-918C-5840C2B2EB32";
CommandLine = "\"Uninstall MEP.bat\"";
DateTime = "20191010114100.133000+000";
DriveLetter = "";
MachineName = "xyz";
PackageName = "HGC00031";
ProcessID = 2628;
ProgramName = "SCEP Uninstall";
SiteCode = "HGC";
ThreadID = 4116;
Win32ErrorCode = 2147942402;
WorkingDirectory = "";
};
execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Raised Program Bad Environment Event for Ad:HGC20016, Package:HGC00031, Program: SCEP Uninstall execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
EnterRsRuningState failed to run script "Uninstall MEP.bat" 0x87d01106 execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Fatal error 0x87d01106 enountered for program SCEP Uninstall. This program will not retry. execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Requesting MTC to delete task with id: {AAA735E9-906A-4EEA-A775-A8764CE2931D} execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
MTC task with id: {AAA735E9-906A-4EEA-A775-A8764CE2931D} deleted successfully. execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="HGC00031",ProgramID="SCEP Uninstall", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
Requesting MTC to delete task with id: {AAA735E9-906A-4EEA-A775-A8764CE2931D} execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
This execution request does not have a corresponding task in MTC. execmgr 10/10/2019 5:11:00 PM 4116 (0x1014)
MTC task with id {AAA735E9-906A-4EEA-A775-A8764CE2931D}, changed state from 4 to 5 execmgr 10/10/2019 5:11:00 PM 7348 (0x1CB4)

Thanks !
 
First why use a batch file for this?
Secondly, are you computer x64 and the batch file running as x86?
 
Great timing. I was just asked to remove SCEP from our environment.
I was going to use the batch file method as described here:

However, looking at the c:\windows\ccmsetup folder on my latest test machine, the file scepinstall.exe no longer exists. At least not in that directory.
 
First why use a batch file for this?
Secondly, are you computer x64 and the batch file running as x86?
My client wants to uninstall it only through sccm only.

Also i have ran same bat file manually and it worked successfully.
 
Neither of these answers my questions.
He's asking because (well for the second question anyway) if the batch file is being executed in 32-bit the environment is different than what you see when doing it manually which is probably in 64-bit. Things like the env vars for %ProgramFiles% and the registry key for WOW6432Node all present differently. If this is the case you need to force the batch to rerun itself using the cmd.exe in c:\windows\sysnative

If you want to see what the batch sees while running, open a command console using c:\windows\syswow64\cmd.exe
 
First why use a batch file for this?
Garth, I can't answer for Rohit. However, Can I build on your response and ask,' if not the batch file method, is there a better way to remove SCEP from all of my clients?' I'll create a separate post if this question will muddy the waters too much.
 
Fatal error 0x87d01106 enountered for program SCEP Uninstall. This program will not retry. execmgr 0x87d01106 = Failed to verify the executable file is valid or to construct the associated command line.

Can you try creating the package again > deploy and test it ?.
 
Garth, I can't answer for Rohit. However, Can I build on your response and ask,' if not the batch file method, is there a better way to remove SCEP from all of my clients?' I'll create a separate post if this question will muddy the waters too much.

Here are two answers for you, the first one, I haven't tried before, so YMWV.
Have you tried just turning off EP in the Client setting, does that remove EP from the computer?
Assuming Rohit command line is right, why not just use the command line directly. aka don't wrap the command line in a batch file. C:\Windows\ccmsetup\scepinstall.exe /u /s
 
Here are two answers for you, the first one, I haven't tried before, so YMWV.
Have you tried just turning off EP in the Client setting, does that remove EP from the computer?
Assuming Rohit command line is right, why not just use the command line directly. aka don't wrap the command line in a batch file. C:\Windows\ccmsetup\scepinstall.exe /u /s
If we disable EP in client setting it will not remove the client.
 

Forum statistics

Threads
7,166
Messages
27,975
Members
18,278
Latest member
MLab

Latest posts

Trending content

Back
Top