Skip to content

Deploy .BAT files

Featured Replies

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.

please past here the logs information... ? Without logs we can't help you! :)

  • Author
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)


  • Author

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
  • Author

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 =(

  1. Start by getting rid of the last line of the batch file
  2. Replace C:\Window with %windir%
  3. On the system in question, make sure that inst_cap.exe exists

for the script, I'd use @start /wait on the removal command - so that only when the process is done, the second step starts.

  • Author
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.