Running a Batch file through SCCM

I have an installed Endpoint security program installed on 1800 systems in our domain. I have a batch file that is succesfully when run on a system. The batch is below. I've starred the sensitive info and path, (thing to remember is this batch
works on a target system).
REG ADD HKLM\SOFTWARE\***\***\Input /v PSUrl /d "*********" /f
REG ADD HKLM\SOFTWARE\***\***/v *******/d 1 /f
SC control *****232
SC control *****225
msiexec /x {*********************} /qn UNINSTALL_PASSWORD=******** REBOOT=ReallySuppress
Exit /B 0
The first 4 lines migrate where the software points to a new server, the second phase removed the software (permitted following the move). following the msiexec /x is the msi registry key of the software to be uninstalled.
I can see the job has been sent to the test clients and been accepted by them however thats it nothing happens after that.
Question 1 - can anyone give me a step by step of running this batch through SCCM as I'm obviously doing something wrong.
Question 2 - Which Client SCCM logs do I look in to see what happens after the batch hits the client.

Hi Jason,
Yes to all of the questions above:
Created Package; set distribution point, linled the programs (command line "programname.bat" also tried "programname.cmd"
Created advertisment and schedule targeting collection. Nothing appears in execmgr.log
Something should appear in execmgr.log.  I'm assuming the client is a member of the collection, the advertisement available time has passed, and the mandatory assignment time has passed?  I'm also assuming that other advertisements are working
on that client? 
If so, that information should be in execmgr.log.  You should be able to search for the advertisement ID and the package ID.  Otherwise, no there are no special tricks to make a batch file run via SCCM advertisements.  You should see that
command line launched in execmgr.log.

Similar Messages

  • Run batch files through java code

    Hi All
    I need to run a batch file using java code . I am not getting any error, but also no output. Can someone let me know the problem with my code.The code i am using is
    import java.io.*;
    public class batchtest {
         public static void main(String[] args) {
              Runtime r = Runtime.getRuntime();
         Process p= null;
         String line;
              try{
              p = r.exec("cmd /c testBatch.bat");
              BufferedReader input = new BufferedReader
              (new InputStreamReader(p.getInputStream()));
         while ((line = input.readLine()) != null) {
         System.out.println(line);
         input.close();
              System.out.println("running...");
              }catch(Exception e)
                   e.printStackTrace();
    }

    Maybe this helps:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Running a batch file - VERY URGENT .. help

    Hi people
    I am attempting to run a batch file from with a JSP page.
    the code i am using is:
    Runtime runtime = Runtime.getRuntime();
    Process process = runtime.exec("cmd.exe /c d:\\uploadfiles.bat");
    This jsp file is located on the c: of a webserver.
    the uploadfiles.bat is located on the d: of the webserver and the code is:
    copy d:\videos\008214?.rm d:\blah
    copy d:\images\008214.* d:\blah
    copy d:\xml\008214.* d:\blah
    cd \blah
    pkzip -es -m 008214.zip *.*
    copy 008214.zip d:\upload\008214.zip
    del 008214.zip
    If I run this batch file from a command line, it works fine, though when I try and call it through my JSP page, it doesnt do anything .. a command window just pops up for a while, and then closes.
    How can I fix this ... I need this quite quickly
    Thanks people

    1) It is O.K. that you see nothing in that console. Its output is captured by Java and is not displayed on the screen.
    In general, that console should not be visible, but actually it behaves differently according to JDK and OS versions (treat that as a feature).
    2). Look at this article:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    It it does not answer your problem, try to search the forums:
    http://search.java.sun.com/search/java/index.jsp?qp=%2Bforum%3A31&nh=10&qt=%2B%22exec%22+-%22Replies%3A+0%22&col=javaforums
    Questions about Runtime.exec() has been asked hundreds of times.
    3) runtime.exec() can execute BAT files. It is not necessary to specify that "cmd /C".

  • Problems Force Running a batch file

    Hi There,
    I am trying to force-run a batch file to copy files from a local NBO Appliance to the C:\tmp directory on the user's workstation. The batch file lives at c:\tmp\branding.bat.
    I cant get the batch file to force run. Zen reporting advises that the batch file has distributed and launched successfully, however the files do not copy.
    However, if i click on the icon for the batch file app - the files copy no problem. I have tried running Workstation Associated and (Unrestricted) User Associated as well as Workstation - Force Run as User.
    Path to executable file:
    %*WinSysDir%\cmd.exe
    Parameters:
    /c "c:\tmp\branding.bat"
    Any ideas? The batch file has to refer to the P: drive as the application covers 40 different sites each with their own appliance containing source files.
    Running NBO2 - ZFD 4 Agent 4.0.1.60 - Clientless
    Desktop XP Workstations
    Thanks
    Thax

    Have the app object copy the batch file to the hard drive from the
    server and then run it locally. This should work with a Middle Tier server.
    thax wrote:
    > Hi there,
    >
    > I cant use the actual server name as this is an application which runs
    > through a middle tier server for multiple NBO sites so therefore needs to
    > use the P: reference...
    >
    >>>> kokoo<[email protected]> 9/03/2006 12:37 >>>
    >
    > TRY edit Scrirts:
    > #\\FS_SERVER_name\VOL\BATCH.BAT
    >
    > edit batch file:
    > xcopy "p:\nal\wxp\ZenPolicies\Branding\*.*" "C:\tmp\ZenPolicies\Branding\"
    > /s /v /e /y
    > ==>
    > xcopy p:\nal\wxp\ZenPolicies\Branding\*.* C:\tmp\ZenPolicies\Branding\ /s
    > /v /e /y
    >
    > "thax" <[email protected]>
    > *******:[email protected]...
    > Hi Jeremy,
    >
    > xcopy "p:\nal\wxp\ZenPolicies\Branding\*.*" "C:\tmp\ZenPolicies\Branding\"
    > /s /v /e /y
    > pause
    >
    > Thax
    >
    > >>> Jeremy Mlazovsky<[email protected]> 8/12/2005 00:20
    >
    > Can we see the contents of your batch file?
    >
    > thax wrote:
    > > Hi There,
    > >
    > > I am trying to force-run a batch file to copy files from a local NBO
    > > Appliance to the C:\tmp directory on the user's workstation. The batch
    >
    > > file lives at c:\tmp\branding.bat.
    > >
    > > I cant get the batch file to force run. Zen reporting advises that the
    >
    > > batch file has distributed and launched successfully, however the files
    >
    > > do not copy.
    > >
    > > However, if i click on the icon for the batch file app - the files copy
    >
    > > no problem. I have tried running Workstation Associated and
    > > (Unrestricted) User Associated as well as Workstation - Force Run as
    > User.
    > >
    > >
    > > Path to executable file:
    > >
    > > %*WinSysDir%\cmd.exe
    > >
    > > Parameters:
    > >
    > > /c "c:\tmp\branding.bat"
    > >
    > > Any ideas? The batch file has to refer to the P: drive as the
    > > application covers 40 different sites each with their own appliance
    > > containing source files.
    > >
    > > Running NBO2 - ZFD 4 Agent 4.0.1.60 - Clientless
    > >
    > > Desktop XP Workstations
    > >
    > > Thanks
    > >
    > > Thax
    > >
    >
    >
    Jeremy Mlazovsky
    Senior System Engineer - Enterprise Desktop
    UDit-Central Hardware Systems & Network Storage
    University of Dayton
    http://forge.novell.com/modules/xfmod/project/?udimage
    http://vmpconfig.sourceforge.net/
    http://regeditpe.sourceforge.net

  • Running a batch file

    String path = "";
    path = "cmd /c start FCall.bat";
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(path);
    //proc.destroy() ; The code works fine, however, I need some help in exiting the command window. After executing the batch file the window should close. I have tried "destroy" didnt work it kills the entire process. Is there a function I am missing to accomplish this ?

    warnerja,
    I am compiling my program through command prompt. One of my method that contains the above mentioned code, runs the batch file. In doing so, it opens cmd.exe window. I want that window to be closed once the batch file ends running.
    The path associated with the cmd.exe is the same as the path where I am compiling my java code.
    Any suggestion ?

  • Trying to run a batch file in ODI and the file is on a windows network drive.

    Hi,
    I'm trying to run a batch file that is located on a windows shared drive for the ODI server. When I try to run the file through OS command by giving the file path in the "command line". I get the error "
    ODI-1226: Step fails after 1 attempt(s).
    ODI-1242: Operating system command execution fails."
    Please let me know if this can be done.

    Hi,
    First try to execute your batch file, if it is executing as expected.
    Then use OdiOSCommand tool and give full path of script and also give a path to create error file & out file.
    Execute the batch now via OdiOSCommand, if it fails then you will receive error message in Error file.
    Also check if you have rights to script being executed via ODI.
    Thanks,
    DK

  • Run a batch file by passing parameters

    Hi all,
    I want to pass a parameter(a filename) to an antivirus batch file.
    I then want to run that batch file.
    All of the above should be accomplished through a Java program.
    Pls help.

    hi
    u can do one thing
    read batch file and replace filename with your filename object as much times you want
    u need to read and write file in java
    see io and file api

  • I have few PDf files on my computer and I want to add them to my ipod touch, please tell me the procedure on how should I do that? Secondly I want to run these Pdf files through the ibook app, as it also have the Pdf file sections

    I have few PDf files on my computer and I want to add them to my ipod touch, please tell me the procedure on how should I do that? Secondly I want to run these Pdf files through the ibook app, as it also have the Pdf file sections

    You should be able to just place them in your Books library in iTunes and check to ensure that your Book library is configured to sync to your iPod when you sync your iPod to iTunes.

  • Running a batch file in a java servlets programme

    this is what i have
    Process p = Runtime.getRuntime().exec("C:\\sync.bat");
    Now i need a way for the program to wait until this is finished running. I dont want to print anything until this is done. Is there a way to do this

    Will this even run sync.bat or do i have to do more.Here is my entire code
    import java.io.*;
    import java.io.File;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.swing.*;
    public class index_test extends HttpServlet
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              res.setContentType("text/html");
              PrintWriter out = res.getWriter();
              out.println("<HTML>");
              out.println("<body>");
              try
                   Process p = Runtime.getRuntime().exec("C:\\sync.bat");
                   String dir = "C:\\Perforce";
                   File what = new File(dir);
                   String [] listy = new String [100];
                   String [] products = new String[5];
                   String lists;
                   listy = what.list();
                   out.println("<form action =getBuilds Method = get>");
                   out.println("Please select which Product you wish to search in: ");
                   out.println("<br>");
                   int j = 0;
                   if(listy[j] != null)
                        products[j] = listy[j];
                        j++;
                   int i =0;
                   for(i = 0; i<listy.length && listy[i] !=null;i++)
                        out.println("<input type ='radio' name = 'product' value='"+dir+"\\"+products[i]+"\\build'>");
                        out.println(products);               
                        out.println("<br>");
                   out.println("<input type ='submit' value ='Submit'>");
                   out.println("<br>");
              catch(IOException e){}
              out.println("<img src='C:\\tomcat4\\webapps\\Tracker\\dancing2.gif'>");
              out.println("</form></body></html>");
    What i need is to run sync.bat, wait till its finished then print out the folders in the Perforce directory. I can print out the contents of Perforce grand i just dont know how to run the batch file and get the progeam to wwait until its finished

  • Running a Batch File on another Server with an Oracle Job

    hi, i have the following code
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'test_job_bat',
    job_type => 'EXECUTABLE',
    job_action => '\\10.1.1.63\test\test.bat',
    enabled => true,
    comments => 'test bat'
    END;
    So i want to run a batch file, which lies on another pc in the network
    The code runs, without a failure.
    The bat file just contains "MD D:\bla" .
    When i run the code, no bla directory is created, so it seems that the batch file never ran.
    i approved read/write on the test folder. (Windows 7 machine)
    any ideas?
    Edited by: user1067632 on 31.05.2010 05:03
    in dba_scheduler_job_run_details the job is listed as FAILED:
    ORA-27370: Job-Unterprozess konnte einen Job vom Typ EXECUTABLE nicht starten
    ORA-27300: BS-abhängiger Vorgang accessing execution agent mit Status: 2 nicht erfolgreich
    ORA-27301: BS-Fehlermeldung: Das System kann die angegebene Datei nicht finden.
    ORA-27302: Fehler aufgetreten bei: sjsec 6a
    ORA-27303: Zusätzliche Informationen: Das System kann die angegebene Datei nicht finden.
    Edited by: user1067632 on 31.05.2010 05:16

    ok sorry, i made my testjob run, the OracleJobScheduler was not started.
    But now i ran into an another Problem.
    Now i want to java bla.jar in my batch, and got that new error
    ORA-27369: Job vom Typ EXECUTABLE nicht erfolgreich mit Exit-Code: Unzulässige Funktion.
    STANDARD_ERROR="Unable to access jarfile start.jar"
    anything to consider when accessing .jar files in my batch?
    edit:
    there was a classpath problem.
    Edited by: ginkgo on 01.06.2010 04:29

  • Running a batch file on ftp server

    HI All,
    i am trying to use Command line facility of file adapter to run a batch file..
    i batch file i have a single command as
    mkdir ranjeet.
    how should i call this batch file from file adapter..
    i tried putting batch file name in the command line section. I had copied the batch file on ftp server at location of Target Directory..but in audit log of adapter i am getting error as OS command cannot be executed..

    Ranjeet,
    >>ok..but what will command to be run of ftp run..
    How do you expect any one of us to know what your ftp server is based on.
    The previous reply by Carme has answered your XI query and to the point. You acknowledge it with a <b>ok</b>!! I guess it is too rude on your part.
    Anway answering your question, that depends on your FTP server. Log in to your FTP server manally and try executing these commands and check.
    Regards,
    Jai Shankar

  • Running a batch file to invoke reports runtime

    Hi,
    I'd like to run a batch file at the end of every month automatically, which runs a report and sends the output in a mail. Is there a way to run this batch file without using cron job? We do not have unix environment at our place.
    ThanX.

    hello,
    on windows NT you have the AT functionality which is basic scheduling. however if you are using the oracle reports server you can schedule the report inside the server itself.
    regards,
    the oracle reports team

  • Running a batch file placed on a remote terminal????

    Hi all,
    How can I run a batch file which is located in machine A from machine B.?
    which is the best technology to go for?
    In RMI I need to have a server program running always to run the batch file, so any other alternative where in on demand invocation of batch file can be done.
    A web service is going to invoke this, so plz give me the best way to do this guys..
    waiting for ur reply
    Mithun

    How can I run a batch file which is located in
    machine A from machine B.?
    which is the best technology to go for?JVirus

  • Running a batch file inside a jar

    HI all
    I created a jar file , in which i need to run a batch file , so i wrote a main class to execute the run the batch file , but when iam running the jar it is searching for the given batch file out side the jar.
    my code is some thing like below
         public static void main(String args[])
              try
                   Runtime rt=Runtime.getRuntime();
                   Process process=rt.exec("%DIRNAME%/start.bat");
       InputStreamReader reader =
                      new InputStreamReader ( process.getInputStream () );
                   BufferedReader buf_reader =
                       new BufferedReader (  reader );
                    String line;
                    while ((line = buf_reader.readLine ()) != null)
                                 System.out.println (line);
              catch (IOException e) {
                    System.out.println (e);
         }so please help me.. is it the problem in specifing the path...?
    are does it have any other method to read the stream functions ..
    thanks in advance
    sam

    I don't think this will work. You could not go to a command line and enter, "%DIRNAME%/start.bat" if start.bat was inside a jar - the CLI doesn't know how to read a batch file inside a jar.
    I think it would work to programmatically read the lines of start.bat (when it is inside the jar) into an array of Strings and use Runtime.exec with the array as the argument.
    It would also work to extract the start.bat file, then execute it using Runtime.exec.

  • Running a batch file on  a web server

    hi,
    i am facing a problem regarding running a batch file(with a java command in that file) on a web server.
    i am having a batch file which is running a chatapplication (this file is having a single line -- "java ChatServer 8080")
    i want to execute this command ( file ) on my web server
    can u help me plz ( i think u can)
    thanx 4 reading my problem...
    -ashish

    thanx 4 replying
    but as i am a developer and i am developing the aplication for a client, so should i speak to the client for this or can i do this without interrupting them?
    -ashish

Maybe you are looking for

  • I can't reply to a post because I'm not logged in. Can't login - no account. Can't register, no register option. HELP!!!!

    Gosh, you guys make it really, really, really difficult to register an account with Mozilla. I have to ask a question, but I actually wanted to post a reply. I need to login to my account to post a reply, but I don't have an account. I want to regist

  • Acrobat plug-in interfering with Safari quit

    I'm using Acrobat 8.0, Safari 3.2.3. When I quit Safari it quits normally but then I get an error message saying that Safari has quit without notice, probably due to an Acrobat Plug-in. So far it is an annoyance, not a substantive problem, but it mak

  • Use of sftp in a script

    Hi, I have a requirement wherein the client is asking us to take an export backup of a schema (database running on HPUX Itanium 64 bit) and then copy the dump file to a Windows box (Windows 2003 server). This has to be done every Monday at 1AM. I wan

  • Inconsistent behaviour of PSEvent.MOVE

    I'm having trouble understanding/handling Photoshop's 'move' event. I'm trying to track a shape movement but the event is only being triggered once after another action - for example when I drag the shape around, the event is fired on the first drop,

  • Old MacBook just sits on blank desktop background

    My mom has an early 2000 model MacBook that was going strong until a few days ago.  It will let her log in, but then just sits on the blank desktop background.  Nothing else comes up.  The original startup disk is long gone.  She needs a new battery