deploy batch file

How do you deploy a bat file in sccm 2012.  In 2007 it was easy.  In 2012 I cnanot get a bat file to run  I am gettting an error 10006.


In execmgr I am getting only 

Script for Package:EHC00015, Program: FEP Fix failed with exit code 2

Execution is complete for program FEP Fix. The exit code is 2, the execution status is FailureNo

August 31st, 2015 1:46pm

here is my bat file,

del c:\windows\System32\GroupPolicy\Machine\registry.pol /F
gpupdate/force
taskkill ccmexec
net start ccmexec

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 1:49pm

Well it look like SCCM was able to run the script. The script return a exit code of 2 to SCCM.

Not sure killing ccmexec is a good thing while having SCCM run stuff ?

error 2 if memory serve me well is something about The system cannot find the file specified. Indicates that the file can not be found in specified location.

August 31st, 2015 1:52pm

yes it should work the same but it is not!
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 1:54pm

Just make a new application select the manually specified information. 

Enter all the information you want when you get to the deployment you can simply select script installer. When you get to the command to run select the script. This is for application.

For a package just make a new one give it a name and a data source. create a standard program and enter the name and when you select command line just select the script and all the other options you need.

Quick how to: https://desktopengineer.wordpress.com/2012/01/05/sccm-2012-deploying-bat-files-and-scripts/

August 31st, 2015 1:59pm

I am following your link, does not work
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 2:27pm

The link works fine for me.

Also, Frederick is correct, it's not just supposed to work the same way, it does work the same way. Can you post the complete and unedited snippet from execmgr.log please? A single out of context line is pretty meaningless even if that line contains an error code -- log files are about context and flow.

August 31st, 2015 2:45pm

Here is the log for the time frame with the last job that failed

Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00016",ProgramID="sdf", actionType 45l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 7108 (0x1BC4)
Policy arrived for parent package EHC00017 program FEP GPO Fix execmgr 08/31/2015 11:46:47 AM 7108 (0x1BC4)
Requesting content from CAS for package EHC00017 version 1 execmgr 08/31/2015 11:46:47 AM 7592 (0x1DA8)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 6l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 7108 (0x1BC4)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramOfferReceivedEvent
{
AdvertisementId = "EHC2000C";
ClientID = "GUID:D846D66E-5018-479C-ACF8-3C2BB42AE531";
DateTime = "20150831184647.194000+000";
MachineName = "DEPLOYMENT";
ProcessID = 4012;
SiteCode = "EHC";
ThreadID = 7108;
};
execmgr 08/31/2015 11:46:47 AM 7108 (0x1BC4)
Successfully created a content request handle {BE689515-B612-42EE-8315-62502351ACEA} for the package EHC00017 version 1 execmgr 08/31/2015 11:46:47 AM 7592 (0x1DA8)
Program FEP GPO Fix change to state STATE_ADVANCED_DOWNLOAD content in progress execmgr 08/31/2015 11:46:47 AM 7592 (0x1DA8)
Execution Request for advert EHC2000C package EHC00017 program FEP GPO Fix state change from NotExist to AdvancedDownload execmgr 08/31/2015 11:46:47 AM 7592 (0x1DA8)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 7592 (0x1DA8)
Mandatory execution requested for program FEP GPO Fix and advertisement EHC2000C execmgr 08/31/2015 11:46:47 AM 6532 (0x1984)
Creating mandatory request for advert EHC2000C, program FEP GPO Fix, package EHC00017 execmgr 08/31/2015 11:46:47 AM 6532 (0x1984)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistWaitingContentEvent
{
AdvertisementId = "EHC2000C";
ClientID = "GUID:D846D66E-5018-479C-ACF8-3C2BB42AE531";
DateTime = "20150831184647.272000+000";
MachineName = "DEPLOYMENT";
PackageName = "EHC00017";
PackageVersion = "1";
ProcessID = 4012;
ProgramName = "FEP GPO Fix";
SiteCode = "EHC";
ThreadID = 6532;
};
execmgr 08/31/2015 11:46:47 AM 6532 (0x1984)
Successfully raised SoftDistWaitingContentEvent event for program FEP GPO Fix execmgr 08/31/2015 11:46:47 AM 6532 (0x1984)
Execution Request for advert EHC2000C package EHC00017 program FEP GPO Fix state change from WaitingDependency to WaitingContent execmgr 08/31/2015 11:46:47 AM 6532 (0x1984)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 6532 (0x1984)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 2756 (0x0AC4)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 7592 (0x1DA8)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 7788 (0x1E6C)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 4808 (0x12C8)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:47 AM 6488 (0x1958)
  Processing [{BE689515-B612-42EE-8315-62502351ACEA}, 0]: OnContentAvailable execmgr 08/31/2015 11:46:49 AM 6488 (0x1958)
[{BE689515-B612-42EE-8315-62502351ACEA}]: Content Version 1 is available for advert EHC2000C, pkg: EHC00017, program FEP GPO Fix. execmgr 08/31/2015 11:46:49 AM 6488 (0x1958)
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 08/31/2015 11:46:49 AM 6488 (0x1958)
Request a MTC task for execution request of package EHC00017, program FEP GPO Fix with request id: {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28} execmgr 08/31/2015 11:46:49 AM 6488 (0x1958)
Execution Request for advert EHC2000C package EHC00017 program FEP GPO Fix state change from WaitingContent to Ready execmgr 08/31/2015 11:46:49 AM 6488 (0x1958)
MTC task with id {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28}, changed state from 0 to 4 execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:49 AM 6488 (0x1958)
  Processing [{BE689515-B612-42EE-8315-62502351ACEA}, 0]: RemoveNotification execmgr 08/31/2015 11:46:49 AM 6488 (0x1958)
MTC signaled SWD execution request with program id: FEP GPO Fix, package id: EHC00017 for execution. execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Sending ack to MTC for task with id: {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28} execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Executing program FEPGPOFile.bat in Admin context execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Execution Request for advert EHC2000C package EHC00017 program FEP GPO Fix state change from Ready to NotifyExecution execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Checking content location C:\Windows\ccmcache\48 for use execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Successfully selected content location C:\Windows\ccmcache\48 execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Executing program as a script execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Successfully prepared command line "C:\Windows\ccmcache\48\FEPGPOFile.bat" execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Command line = "C:\Windows\ccmcache\48\FEPGPOFile.bat", Working Directory = C:\Windows\ccmcache\48\ execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Created Process for the passed command line execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramStartedEvent
{
AdvertisementId = "EHC2000C";
ClientID = "GUID:D846D66E-5018-479C-ACF8-3C2BB42AE531";
CommandLine = "\"C:\\Windows\\ccmcache\\48\\FEPGPOFile.bat\"";
DateTime = "20150831184649.518000+000";
MachineName = "DEPLOYMENT";
PackageName = "EHC00017";
ProcessID = 4012;
ProgramName = "FEP GPO Fix";
SiteCode = "EHC";
ThreadID = 5268;
UserContext = "NT AUTHORITY\\SYSTEM";
WorkingDirectory = "C:\\Windows\\ccmcache\\48\\";
};
execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Raised Program Started Event for Ad:EHC2000C, Package:EHC00017, Program: FEP GPO Fix execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
MTC task with id {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28}, changed state from 4 to 5 execmgr 08/31/2015 11:46:49 AM 5268 (0x1494)
Program exit code 2 execmgr 08/31/2015 11:47:02 AM 7788 (0x1E6C)
Looking for MIF file to get program status execmgr 08/31/2015 11:47:02 AM 7788 (0x1E6C)
Script for Package:EHC00017, Program: FEP GPO Fix failed with exit code 2 execmgr 08/31/2015 11:47:02 AM 7788 (0x1E6C)
Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of SoftDistProgramErrorEvent
{
AdvertisementId = "EHC2000C";
ClientID = "GUID:D846D66E-5018-479C-ACF8-3C2BB42AE531";
DateTime = "20150831184702.763000+000";
ExitCode = "2";
MachineName = "DEPLOYMENT";
PackageName = "EHC00017";
ProcessID = 4012;
ProgramName = "FEP GPO Fix";
SiteCode = "EHC";
ThreadID = 7788;
UserContext = "NT AUTHORITY\\SYSTEM";
};
execmgr 08/31/2015 11:47:02 AM 7788 (0x1E6C)
Raised Program Error Event for Ad:EHC2000C, Package:EHC00017, Program: FEP GPO Fix execmgr 08/31/2015 11:47:02 AM 7788 (0x1E6C)
Execution is complete for program FEP GPO Fix. The exit code is 2, the execution status is FailureNonRetry execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)
Requesting MTC to delete task with id: {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28} execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)
MTC task with id: {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28} deleted successfully. execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 10l, value Result:FALSE, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)
Requesting MTC to delete task with id: {D3C229BF-258C-4D56-AB98-EAFF1DC7EB28} execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)
This execution request does not have a corresponding task in MTC. execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)
Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="EHC00017",ProgramID="FEP GPO Fix", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 08/31/2015 11:47:02 AM 6532 (0x1984)

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 2:52pm

Just had a thought, I think it is erroring due to 

taskkill ccmexec

August 31st, 2015 2:54pm

Well did you try running the script manually.

because am not sure this is supose to work: taskkill ccmexec 

I think you are missing the /im

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 2:59pm

here is my bat file,

del c:\windows\System32\GroupPolicy\Machine\registry.pol /F
gpupdate/force
taskkill ccmexec
net start ccmexe
August 31st, 2015 3:00pm

On several PCs that have been migratged from 07 to 12, FEP policy is erroring with 0x80004005 so I am following 

http://www.sccm.biz/2012/10/sccm-2012-fix-endpoint-protection.html

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 3:23pm

The correct syntax for killing ConfigMgr client would be taskkill /F /IM ccmexec.exe ...although I do not see the point for doing so.
Even the link you posted does not tell you to create a package/program that kills ConfigMgr client, it's only refering to the start/stop action so that you could see the end results quicker, when doing the things manually.
  • Marked as answer by freebird_ 11 hours 50 minutes ago
  • Edited by Narcoticoo 11 hours 50 minutes ago
August 31st, 2015 3:56pm

I realized I forgot the image name as soon as I read your post.  But I have removed that from my bat file and now it runs just fine.  Thanks for point that out!  :)
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 4:01pm

On several PCs that have been migratged from 07 to 12, FEP policy is erroring with 0x80004005 so I am following 

http://www.sccm.biz/2012/10/sccm-2012-fix-endpoint-protection.html

August 31st, 2015 4:04pm

I have removed that line.  I also think it is a bad idea.  

I have a collection for all the PCs that need the bat file ran.  I am going to use rigth click to restart SMS 

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 4:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics