polonio210 Posted April 29, 2016 Report post Posted April 29, 2016 Hello Everyone, I searched for some topics related, but dont find anything. I'm just want to know how i deploy an bat file with the SCCM 2012 that was execute an command line to remove some application. I already createted a package with sourcefile e a Standard Programa with de bat file, but it is doesn't working. Sorry for my bad english. Cheers. Quote Share this post Link to post Share on other sites More sharing options...
ZeZe Posted April 29, 2016 Report post Posted April 29, 2016 please past here the logs information... ? Without logs we can't help you! Quote Share this post Link to post Share on other sites More sharing options...
polonio210 Posted April 29, 2016 Report post Posted April 29, 2016 ExecMgr.log (can be?) I deployed the package at 11:14. Service startup. execmgr 29/04/2016 10:43:08 7984 (0x1F30) A user has logged on. execmgr 29/04/2016 10:43:45 3012 (0x0BC4) Failed to load logging configuration for 'ContentAccess' (87d00275) execmgr 29/04/2016 10:43:46 3012 (0x0BC4) The logged on user is PWI_ADM\carla.paula execmgr 29/04/2016 10:43:46 3012 (0x0BC4) Policy arrived for parent package SPB00051 program Aranda Remove execmgr 29/04/2016 11:23:52 6660 (0x1A04) Mandatory execution requested for program Aranda Remove and advertisement SPB20035 execmgr 29/04/2016 11:23:52 1112 (0x0458) Creating mandatory request for advert SPB20035, program Aranda Remove, package SPB00051 execmgr 29/04/2016 11:23:52 1112 (0x0458) Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SPB00051",ProgramID="Aranda Remove", actionType 6l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 29/04/2016 11:23:52 6660 (0x1A04) Raising event: [sMS_CodePage(850), SMS_LocaleID(1046)] instance of SoftDistProgramOfferReceivedEvent { AdvertisementId = "SPB20035"; ClientID = "GUID:69C3448D-CDB1-425F-AF0F-B3A992954BA7"; DateTime = "20160429142352.455000+000"; MachineName = "SND12566SPBW7P"; ProcessID = 5184; SiteCode = "SPB"; ThreadID = 6660; }; execmgr 29/04/2016 11:23:52 6660 (0x1A04) 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 29/04/2016 11:23:52 1112 (0x0458) Request a MTC task for execution request of package SPB00051, program Aranda Remove with request id: {C0B24ED2-D026-4F32-B147-D93938A1837C} execmgr 29/04/2016 11:23:52 1112 (0x0458) MTC task with id {C0B24ED2-D026-4F32-B147-D93938A1837C}, changed state from 0 to 4 execmgr 29/04/2016 11:23:52 2256 (0x08D0) Execution Request for advert SPB20035 package SPB00051 program Aranda Remove state change from NotExist to Ready execmgr 29/04/2016 11:23:52 1112 (0x0458) Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SPB00051",ProgramID="Aranda Remove", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 29/04/2016 11:23:52 1112 (0x0458) MTC signaled SWD execution request with program id: Aranda Remove, package id: SPB00051 for execution. execmgr 29/04/2016 11:23:52 2256 (0x08D0) Sending ack to MTC for task with id: {C0B24ED2-D026-4F32-B147-D93938A1837C} execmgr 29/04/2016 11:23:52 2256 (0x08D0) Executing program Aranda_Remove.bat in Admin context execmgr 29/04/2016 11:23:52 2256 (0x08D0) Execution Request for advert SPB20035 package SPB00051 program Aranda Remove state change from Ready to NotifyExecution execmgr 29/04/2016 11:23:52 2256 (0x08D0) Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SPB00051",ProgramID="Aranda Remove", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 29/04/2016 11:23:52 2256 (0x08D0) Executing program as a script execmgr 29/04/2016 11:23:53 2256 (0x08D0) Invalid executable file Aranda_Remove.bat execmgr 29/04/2016 11:23:53 2256 (0x08D0) Raising event: [sMS_CodePage(850), SMS_LocaleID(1046)] instance of SoftDistProgramBadEnvironmentEvent { AdvertisementId = "SPB20035"; ClientID = "GUID:69C3448D-CDB1-425F-AF0F-B3A992954BA7"; CommandLine = "Aranda_Remove.bat"; DateTime = "20160429142353.063000+000"; DriveLetter = ""; MachineName = "SND12566SPBW7P"; PackageName = "SPB00051"; ProcessID = 5184; ProgramName = "Aranda Remove"; SiteCode = "SPB"; ThreadID = 2256; Win32ErrorCode = 2147942402; WorkingDirectory = ""; }; execmgr 29/04/2016 11:23:53 2256 (0x08D0) Raised Program Bad Environment Event for Ad:SPB20035, Package:SPB00051, Program: Aranda Remove execmgr 29/04/2016 11:23:53 2256 (0x08D0) EnterRsRuningState failed to run script Aranda_Remove.bat 0x87d01106 execmgr 29/04/2016 11:23:53 2256 (0x08D0) Fatal error 0x87d01106 enountered for program Aranda Remove. This program will not retry. execmgr 29/04/2016 11:23:53 2256 (0x08D0) Requesting MTC to delete task with id: {C0B24ED2-D026-4F32-B147-D93938A1837C} execmgr 29/04/2016 11:23:53 2256 (0x08D0) MTC task with id: {C0B24ED2-D026-4F32-B147-D93938A1837C} deleted successfully. execmgr 29/04/2016 11:23:53 2256 (0x08D0) Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SPB00051",ProgramID="Aranda Remove", actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l execmgr 29/04/2016 11:23:53 2256 (0x08D0) Requesting MTC to delete task with id: {C0B24ED2-D026-4F32-B147-D93938A1837C} execmgr 29/04/2016 11:23:53 2256 (0x08D0) This execution request does not have a corresponding task in MTC. execmgr 29/04/2016 11:23:53 2256 (0x08D0) MTC task with id {C0B24ED2-D026-4F32-B147-D93938A1837C}, changed state from 4 to 5 execmgr 29/04/2016 11:23:53 7040 (0x1B80) Quote Share this post Link to post Share on other sites More sharing options...
polonio210 Posted April 29, 2016 Report post Posted April 29, 2016 I'm just trying to deploy an script like the psexec, i dont know if the best way to do that is deploy as a package. the bat file that i want to deploy is the fallowing one: @echo off C:\Windows\Inst_cap.exe /remove RD C:\Agent /s /q Quote Share this post Link to post Share on other sites More sharing options...
GarthMJ Posted April 29, 2016 Report post Posted April 29, 2016 The error above 2147942402 = The system cannot find the file specified. So, which line of you batch is generating this error? Quote Share this post Link to post Share on other sites More sharing options...
polonio210 Posted April 29, 2016 Report post Posted April 29, 2016 I dont know, my bat file has only 3 lines. @echo off C:\Windows\Inst_cap.exe /remove RD C:\Agent /s /q I just want to remove this application =( Quote Share this post Link to post Share on other sites More sharing options...
GarthMJ Posted April 29, 2016 Report post Posted April 29, 2016 Start by getting rid of the last line of the batch file Replace C:\Window with %windir% On the system in question, make sure that inst_cap.exe exists Quote Share this post Link to post Share on other sites More sharing options...
ZeZe Posted April 30, 2016 Report post Posted April 30, 2016 for the script, I'd use @start /wait on the removal command - so that only when the process is done, the second step starts. Quote Share this post Link to post Share on other sites More sharing options...
polonio210 Posted May 1, 2016 Report post Posted May 1, 2016 Thank you guys... The command line will be like? V V V @echo off Start /wait C:\%windir%\Inst_cap.exe /remove RD C:\Agent /s /q I can't remove the RD command because its clean the software agent. Quote Share this post Link to post Share on other sites More sharing options...
GarthMJ Posted May 1, 2016 Report post Posted May 1, 2016 The idea for removing the RD line is so that you can figure out exactly why you are getting the error message. Quote Share this post Link to post Share on other sites More sharing options...