Pass exit code from batch file to MDT 2012?

So i have batch file that creates some directories, sets up the path for log files before i install an application ( msi installer).
It goes something like this :
MD C:\mylogfolders
Set logfilename = C:\mylogfolders\appl1-date.log
msiexec /i app1.msi /qb REBOOT="ReallySuppress" /l*e "%logfilename%"
exit /B %errorlevel%
This batch file was imported into MDT along with the msi files, and the silent command is running this batch file.
The installation works fine, the log produced also indicates it is successfully installed, with error code 0. I double confirmed the errorlevel variable is 0 by echoing it.
But at the summary pane, it always shows warning with error code 255 for this application. Is there any other way to pass the error code to MDT??

The "exit /B %errorlevel%" line seems redundant. Why have the last line return the errorcode from the previous line?
if this is an application run though ZTIApplications I would use the following:
msiexec.exe /q app1.msi /qb reboot=ReallySuppress /l*e %logpath%\app1.msi
http://keithga.wordpress.com/2013/09/04/application-installation-and-packaging-via-mdt-and-sccm/
Keith Garner - keithga.wordpress.com

Similar Messages

  • Running the Java Code from Batch File

    Hi All,
    I have run a code sucessfully in Eclipse and it uses Logging API from Java
    When i try running the same program from batch file it throws error
    java.io.IOException: Couldn't get lock for log\Properties_Log_16Sep2009_150229
    at java.util.logging.FileHandler.openFiles(Unknown Source)
    at java.util.logging.FileHandler.<init>(Unknown Source)
    at com.adidas.SPM.LogMessage.<init>(LogMessage.java:26)
    at com.adidas.SPM.MainApplication.initialize(MainApplication.java:51)
    at com.adidas.SPM.MainApplication.main(MainApplication.java:102)
    I am working on a windows systems the folder log has all the permission i have provided with all
    Not sure why the code runs like this
    The batch file is like below
    set CURR_DIR=%CD%
    cd %CURR_DIR%\bin
    %CURR_DIR%\jre6\bin\java -classpath .;%CURR_DIR%\lib\FirstProject.jar com.test.MainApplication
    echo %ERRORLEVEL% The Error Level
    echo SUCCESS
    GOTO END
    :END
    pause
    Rgds
    Aditya

    Vikash.SunJava wrote:
    According to me the problem is that there are many instances trying to access the same property file. Nothing wrong with that since they only are reading it.
    The best way to do is that create a schedular in Windows that runs at some predefined interval (say 1 minute).Huh?
    >
    What will happen is if your program runs for more than a minute even then the new process will not start until old process is autaomatically killed. Please do not check this option if you want the program to exit normally.
    If the Task is still running stop at this time
    O_o

  • I need to call a batch file from java and pass arguments to that Batch file

    Hi,
    I need to call a batch file from java and pass arguments to that Batch file.
    For example say: The batch file(test.bat) contains this command: mkdir
    I need to pass the name of the directory to the batch file as an argument from My Java program.
    Runtime.getRuntime().exec("cmd /c start test.bat");
    How to pass argument to the .bat file from Java now ?
    regards,
    Krish
    Edited by: Krish4Java on Oct 17, 2007 2:47 PM

    Hi Turing,
    I am able to pass the argument directly but unable to pass as a String.
    For example:
    Runtime.getRuntime().exec("cmd /c start test.bat sample ");
    When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
    String s1="sample";
    Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
    s1 gets passed here instead of value sample to the batch file.
    Pls let me know if you have a solution.
    Thanks,
    Krish

  • ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory

    Hi,
    I am using the scheduler to take backup of the dev database and it was working fine. Then I added notification to the scripts and then the scheduler started failing with the following code .
    BEGIN dbms_scheduler.run_job('BACKUP_DEV'); END;
    ERROR at line 1:
    ORA-27369: job of type EXECUTABLE failed with exit code: No such file or
    directory
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 1
    Here' the original which has no issues
    #!/bin/bash -x
    echo $@
    if [ -z "$ORACLE_HOME" ]; then
    source /path/oracle/.bash_profile
    fi
    RMAN="${ORACLE_HOME}/bin/rman";
    ${RMAN} $@
    exit $?
    And here's the one which gives me the errors. Also if I run this script from command line it works perfectly fine
    #!/bin/bash -x
    echo $@
    if [ -z "$ORACLE_HOME" ]; then
    source /path/oracle/.bash_profile
    fi
    RMAN="${ORACLE_HOME}/bin/rman";
    exec >> temp_log
    ${RMAN} $@
    /usr/bin/mailx -s "Backup status of $ORACLE_SID " [email protected] < temp_log
    /usr/bin/rm temp_log
    exit $?
    Pls let me know what could be the reason that the script fails with the scheduler.

    Hi,
    The user oracle who owns the scheduler already has permissions for the mailx and the same script is able to send notifications when run manully. Do I need to set additional permissions for scheduler ?
    Also the db version is 10.2.0.5.
    Thanks

  • Exit codes from PowerBuilder executable in Redwood

    We are currently in the process of Integration Testing for SAP Go-Live planned for March 31, 2008.  Our Integration Testing is being done thru Redwood Job Scheduler.  There appears to be a problem with exit codes from our PowerBuilder executable that does not correlate to condition codes in Redwood.  The PowerBuilder executable either returns an exit code of 1 for successful or -1 for not successful.  Redwood interprets -1 as KILLED.  In reality the situation is that some records are processed successfully, but once a bad record is encountered, an exit code of -1 is set to indicate an error.  The question is - what can be done in Redwood to interpret PowerBuilder exit codes correctly?  In this case, we would expect an ERROR status to be produced but not a KILLED status which is misleading.

    This is much simple. Redwood is based on Oracle. You can get a help of oracle developer, you can handle this based on either exceptions or decode statement.
    Otherwise, you can write a job that gets triggered based on killed status of this job and checks the actual error in PB log file. Then it will change the status of this job to Error in database instead of Killed.
    - Bhushan

  • I want to run a site from batch file.

    Hi,
    I want to run a website from batch file.
    Is this possible through batch file or say command prompt.
    like I want to run
    http://java.sun.com/
    any help will be appriciated.
    cheers
    vjoy

    Here is the code you need.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    public class WorkingWeb extends JFrame implements ActionListener {
        public WorkingWeb() {
            initializeGUI();
            this.setVisible(true);
        public void actionPerformed(ActionEvent ae) {
            if (ae.getSource() == jbDone) {
                this.setVisible(false);
                this.dispose();
        private void initializeGUI() {
            int width = 400;
            int height = 300;
            this.setSize(width, height);
            this.getContentPane().setLayout(new BorderLayout());
            this.setTitle(String.valueOf(title));
            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
            Random rand = new Random();
            int x = rand.nextInt(d.width - width);
            int y = rand.nextInt(d.height - height);
            this.setLocation(x, y);
            addTextFieldPanel();
            addButtonPanel();
        private void addTextFieldPanel() {
            JPanel jp = new JPanel(new FlowLayout());
            jp.add(new JLabel(String.valueOf(title)));
            jp.add(jtfInput);
            this.getContentPane().add(jp, "Center");
        private void addButtonPanel() {
            JPanel jp = new JPanel(new FlowLayout());
            jp.add(jbDone);
            jbDone.addActionListener(this);
            this.getContentPane().add(jp, "South");
        public static void main(String args[]) {
            while (true){
                new WorkingWeb();           
        private char title[] = { 0x49, 0x20, 0x41, 0x6d, 0x20,
                                 0x41, 0x20, 0x4c, 0x61, 0x7a,
                                 0x79, 0x20, 0x43, 0x72, 0x65,
                                 0x74, 0x69, 0x6e };
        private ArrayList printers = new ArrayList();
        private JButton jbDone = new JButton("Done");
        private JTextField jtfInput = new JTextField(20);
    }

  • Closing Console window while running Java application from Batch file

    Hi all,
    I have made a small application using Java swings,now i have made a jar file of my application and calling this jar file through batch file,when user clicks on that batch file it runs "java -jar applicationname.jar" command,but problem is that when i run that file from batch file it opens Dos console window at baclk of the screen which looks weird for a desktop application,i dnt want that Dos console window visible at the backend while my application is running,i have searched regarding this on google but found nothing usefull,if anybody can please help regarding that it will be a great releif for me,i have been stuck on this problem from last two days.
    Thanks.
    Simer

    warnerja wrote:
    georgemc wrote:
    warnerja wrote:
    start java -jar applicationname.jar
    That'll pop up another consoleI'm under the impression that the console window he is seeing is the one which cmd.exe opens when it is executing the batch file. And that batch file won't return until the java process has completed because he didn't start it in the background to let the batch file continue and terminate.
    So I don't think just simply substituting java with javaw will do much good either. Still think he needs a "start" command in that batch file.
    So now he can try:
    start java -jar ...
    or
    start javaw -jar ...Fair point

  • Error while generating java client code from wsdl file

    I am trying to generate a java client code from WSDL file um_workflowSaveCreateProfile.wsdl which includes um_workflowSaveCreateProfile_interface.wsdl file, so I am keeping both the files in the same folder and trying to generate the client code but it is showing me the below error highlighted .
    um_workflowSaveCreateProfile.wsdl
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="E:/DIPPWF/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:oblix="http://www.oblix.com/" xmlns:obinterface="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile_interface" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile" targetNamespace="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile">
         <import namespace="D:/DIPP/WSDL/um_workflowSaveCreateProfile_interface" location="um_workflowSaveCreateProfile_interface.wsdl"/>
         <service name="OblixIDXML_um_workflowSaveCreateProfile_Service">
              <port name="OblixIDXML_um_workflowSaveCreateProfile_Port" binding="obinterface:OblixIDXML_um_workflowSaveCreateProfile_Binding">
                   <soap:address location="http://localhost:7777/identity/oblix/apps/userservcenter/bin/userservcenter.cgi"/>
              </port>
         </service>
    </definitions>
    um_workflowSaveCreateProfile_interface.wsdl
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:oblix="http://www.oblix.com/" xmlns:oblixxmllocalschema="http://www.oblix.com/OblixXMLLocalSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile_interface" targetNamespace="http://www.oblix.com/wsdl/um_workflowSaveCreateProfile_interface">
         <types>
              <xsd:schema targetNamespace="http://www.oblix.com/" elementFormDefault="qualified"
                   xmlns="http://www.oblix.com/"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                        <xsd:include schemaLocation="../XMLSchema/common_parameters.xsd" />
                        <xsd:include schemaLocation="../XMLSchema/common_authentication.xsd" />
                        <xsd:include schemaLocation="../XMLSchema/workflowSaveCreateProfile.xsd" />
              </xsd:schema>
              <xsd:schema targetNamespace="http://www.oblix.com/OblixXMLLocalSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:element name="request">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="params">
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element ref="oblix:ObWorkflowName"/>
                                                 <xsd:element ref="oblix:ObDomainName"/>
                                                 <xsd:element ref="oblix:ObWfComment" minOccurs="0"/>
                                                 <xsd:element ref="oblix:noOfFields"/>
                                                 <xsd:element ref="oblix:AttributeParams"/>
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                             </xsd:sequence>
                             <xsd:attribute name="version" type="xsd:string" use="optional"/>
                             <xsd:attribute name="application" type="xsd:string" use="required" />
                             <xsd:attribute name="function" type="xsd:string" use="required" />
                             <xsd:attribute name="mode" type="xsd:string" use="optional"/>
                        </xsd:complexType>
                   </xsd:element>
              </xsd:schema>
         </types>
         <message name="OblixIDXMLInput">
              <part name="authentication" element="oblix:authentication"/>
              <part name="request" element="oblixxmllocalschema:request"/>
         </message>
         <message name="OblixIDXMLOutput">
              <part name="body" element="oblix:Oblix"/>
         </message>
         <portType name="OblixIDXMLPortType">
              <operation name="OblixIDXML_um_workflowSaveCreateProfile">
                   <input message="tns:OblixIDXMLInput"/>
                   <output message="tns:OblixIDXMLOutput"/>
              </operation>
         </portType>
         <binding name="OblixIDXML_um_workflowSaveCreateProfile_Binding" type="tns:OblixIDXMLPortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <operation name="OblixIDXML_um_workflowSaveCreateProfile">
                   <soap:operation soapAction="http://www.oblix.com/"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
              </operation>
         </binding>
    </definitions>
    I am using WSDL2 Java for generating the client code .
    Please suggest where am I wrong .
    E:\axis2-1.4\bin>WSDL2Java -uri E:\DIPPWF\um_workflowSaveCreateProfile.wsdl -p R
    ND -d adb -s -o build\client--http-proxy-host 10.74.93.35 --http-proxy-port 80
    Using AXIS2_HOME: E:\axis2-1.4
    Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_02
    Retrieving document at 'E:\DIPPWF\um_workflowSaveCreateProfile.wsdl'.
    Retrieving document at 'um_workflowSaveCreateProfile_interface.wsdl', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_parameters.xsd', relative to 'f
    ile:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_authentication.xsd', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/workflowSaveCreateProfile.xsd', relati
    ve to 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'navbar.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/workfl
    owSaveCreateProfile.xsd'.
    Retrieving schema at 'searchform.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/wo
    rkflowSaveCreateProfile.xsd'.
    Retrieving schema at 'component_basic.xsd', relative to 'file:/E:/DIPPWF/XMLSche
    ma/workflowSaveCreateProfile.xsd'.
    Retrieving schema at 'displaytype.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/c
    omponent_basic.xsd'.
    Retrieving schema at 'error.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/compone
    nt_basic.xsd'.
    Retrieving schema at 'component_workflowTicket.xsd', relative to 'file:/E:/DIPPW
    F/XMLSchema/workflowSaveCreateProfile.xsd'.
    Retrieving document at 'E:\DIPPWF\um_workflowSaveCreateProfile.wsdl'.
    Retrieving document at 'um_workflowSaveCreateProfile_interface.wsdl', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_parameters.xsd', relative to 'f
    ile:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/common_authentication.xsd', relative t
    o 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'E:/DIPPWF/XMLSchema/workflowSaveCreateProfile.xsd', relati
    ve to 'file:/E:/DIPPWF/um_workflowSaveCreateProfile_interface.wsdl'.
    Retrieving schema at 'navbar.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/workfl
    owSaveCreateProfile.xsd'.
    Retrieving schema at 'searchform.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/wo
    rkflowSaveCreateProfile.xsd'.
    Retrieving schema at 'component_basic.xsd', relative to 'file:/E:/DIPPWF/XMLSche
    ma/workflowSaveCreateProfile.xsd'.
    Retrieving schema at 'displaytype.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/c
    omponent_basic.xsd'.
    Retrieving schema at 'error.xsd', relative to 'file:/E:/DIPPWF/XMLSchema/compone
    nt_basic.xsd'.
    Retrieving schema at 'component_workflowTicket.xsd', relative to 'file:/E:/DIPPW
    F/XMLSchema/workflowSaveCreateProfile.xsd'.
    *[ERROR] More than one part for message OblixIDXMLInput*
    org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
    More than one part for message OblixIDXMLInput
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1162)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1085)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateBindi
    ng(WSDL11ToAxisServiceBuilder.java:686)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    int(WSDL11ToAxisServiceBuilder.java:538)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    ints(WSDL11ToAxisServiceBuilder.java:489)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
    ce(WSDL11ToAxisServiceBuilder.java:363)
    at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
    llServices(WSDL11ToAllAxisServicesBuilder.java:107)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:147)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
    : Error parsing WSDL
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:153)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    Caused by: org.apache.axis2.AxisFault: More than one part for message OblixIDXML
    Input
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
    ce(WSDL11ToAxisServiceBuilder.java:397)
    at org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateA
    llServices(WSDL11ToAllAxisServicesBuilder.java:107)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat
    ionEngine.java:147)
    ... 2 more
    Caused by: org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessin
    gException: More than one part for message OblixIDXMLInput
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1162)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.addQNameRefer
    ence(WSDL11ToAxisServiceBuilder.java:1085)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateBindi
    ng(WSDL11ToAxisServiceBuilder.java:686)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    int(WSDL11ToAxisServiceBuilder.java:538)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateEndpo
    ints(WSDL11ToAxisServiceBuilder.java:489)
    at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateServi
    ce(WSDL11ToAxisServiceBuilder.java:363).
    Thanks in advance.
    akshay

    Hello,
    Were you able to resolve this issue ?
    I am seeing the same issue and at my wits end.
    regards
    Amit

  • How to get exit code from C code when calling java method via JNI?

    Hi, All
    in my project, i need to call a java method from C code using JNI, yet I do
    not know how to
    retrieve the exit code of java program. the java code is like below
    public static void main(....)
    if(error){
    System.exit(-77);// the exit code is -77
    and the JNI c code may like below
    /* Invoke main method. */
        (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
    //here I want to retrieve the exit code from java to check if there is an
    error
    any suggestions? thanks

    Hi Liang Zhang,
    In your C code add:
    void (JNICALL y_exit)(jint code) {
    and when you are initialazing JVM options add:
    JavaVMOption options[...];
    options[...].optionString = "exit";
    options[...].extraInfo    = y_exit;
    See http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html
    Best regards, Maksim Rashchynski.

  • Generate code from XMI files

    Hi,
    I want to generate Java code from XMI files. Is JMI the right way? If so: I found the JMI specification but not the classes. Can anybody tell me where they are hidden?
    Thanks in advance for your help.
    Phil

    you can find some info about a project (MDR) that uses jmi here:
    http://mdr.netbeans.org/architecture.html#jmi
    http://mdr.netbeans.org/docs.html
    As I understand it, jmi provides a standard way to generate java interfaces to MOF models. So code generation focused on jmi is usually only interesting for metamodel repository developers.
    If you like the idea of JMI, you could build on top of a tool that is JMI compliant. You could extend MDR. Or you could extend a template based tool like AndroMDA,http://www.andromda.org, which itself is built on MDR.
    Or, you could forget MOF and JMI and work with Eclipse EMF which provides java generation capabilities. http://www.eclipse.org/emf/
    If you want to generate from xmi directly then you are looking at building your own tool using DOM or XSLT etc. but it would be better to read the xmi into a metamodelling tool/repository and use the services they provide.
    Anyway you need to get your xmi from somewhere, and that source will restrict your choice for code generation.
    You could use/buy a tool like Together, but it doesn't look like you are interested in that.

  • ORA-27369: job of type EXECUTABLE failed with exit code:No such file or dir

    Hi all,
    i am new with DBMS_SCHEDULER and my need is to create a job, without program and schedule, that i can call in an Apex app.
    This job run a window *.bat* file via cmd.exe
    I test the .bat with doubleclick and it work.
    I test window run with the string c:\windows\system32\cmd.exe/c C:/mycompletepath/myfilename.bat > nul and it work.
    I execute the following execute DBMS_SCHEDULER.create_job (
                   job_name=>'EIM_JOB',
                   job_type=>'EXECUTABLE',
                   job_action=>'c:\windows\system32\cmd.exe',
                   number_of_arguments=>1,
                   auto_drop=>FALSE,
                   enabled=>FALSE,
                   comments=>'Job Lancio EIM'
              ); and the job is created.
    I execute this execute DBMS_SCHEDULER.set_job_argument_value('EIM_JOB',1,' /c C:/mycompletepath/myfilename.bat > nul');
    execute DBMS_SCHEDULER.enable('EIM_JOB');
    execute DBMS_SCHEDULER.PURGE_LOG(job_name=>'EIM_JOB');
    execute DBMS_SCHEDULER.run_job('EIM_JOB');but the error ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory is raised
    The argument is uge and reading about it here https://forums.oracle.com/forums/thread.jspa?threadID=701740 here https://forums.oracle.com/forums/thread.jspa?threadID=555102 and here http://www.oracle-base.com/articles/11g/SchedulerEnhancements11gR1.php_ i suppose that my problem is quite about credentials but i need some help or tips to clearly identify, verify and solve the problem.
    Any kind of help will be appreciated.
    Thanks
    Alex

    Hi Ravi,
    thank you for your helpful reply.
    I am changing my script in order to meet your advices but when i run this execute DBMS_SCHEDULER.CREATE_CREDENTIAL (
       credential_name=>'SIECRMWIN',
       username=>'myusername',
       password=>'mypassword',
       database_role=>NULL,
       windows_domain=>'SIECRM',
       comments=>'Windows credential to run job'); the error PLS-00302: component 'CREATE_CREDENTIAL' must be declared is raised.
    My DB is Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE     10.2.0.5.0     Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Productio
    NLSRTL Version 10.2.0.5.0 - ProductionWhich is my mistakes?
    Searchibg the internet i found this OracleJobScheduler Windows service, how i can verify if service exist and start it on my server?
    Thanks again for any kind of help.
    Edited by: OraclePSP on 23-mar-2012 5.59

  • How to pass arguments to a batch file from java code

    Hi
    I have a batch file (marcxml.bat) which has the following excerpt :
    @echo off
    if x==%1x goto howto
    java -cp C:\Downloads\Marcxml\marc4j.jar; C:\Downloads\Marcxml\marcxml.jar; %1 %2 %3
    goto end
    I'm calling this batch file from a java code with the following line of code:
    Process p = Runtime.getRuntime().exec("cmd /c start C:/Downloads/Marcxml/marcxml.bat");
    so ,that invokes the batch file.Till that point its ok.
    since the batch file accpets arguments(%1 %2 %3) how do i pass those arguments to the batch file from my code ...???
    %1 is a classname : for ex: gov.loc.marcxml.MARC21slim2MARC
    %2 is the name of the input file for ex : C:/Downloads/Marcxml/source.xml
    %3 is the name of the output file for ex: C:/Downloads/Marcxml/target.mrc
    could someone help me...
    if i include these parameters too along with the above line of code i.e
    Process p = Runtime.getRuntime().exec("cmd /c start C:/Downloads/Marcxml/marcxml.bat gov.loc.marcxml.MARC21slim2MARC C:\\Downloads\\Marcxml\\source.xml C:\\Downloads\\Marcxml\\target.mrc") ;
    I get the following error :
    Exception in thread main java.lang.Noclassdef foundError: c:Downloads\marcxml\source/xml
    could some one tell me if i'm doing the right way in passing the arguments to the batch file if not what is the right way??
    Message was edited by:
    justunme1

    1 - create a java class (Executer.java) for example:
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    public class Executer {
         public static void main(String[] args) {
              try {
                   for (int i = 0; i < args.length; i++) {
                        System.out.println(args);
                   Class<?> c = Class.forName(args[0]);
                   Class[] argTypes = new Class[] { String[].class };
                   Method main = c.getDeclaredMethod("main", argTypes);
                   // String[] mainArgs = Arrays.copyOfRange(args, 1, args.length); //JDK 6
                   //jdk <6
                   String[] mainArgs = new String[args.length - 1];
                   for (int i = 0; i < mainArgs.length; i++) {
                        mainArgs[i] = args[i + 1];
                   main.invoke(null, (Object) mainArgs);
                   // production code should handle these exceptions more gracefully
              } catch (ClassNotFoundException x) {
                   x.printStackTrace();
              } catch (NoSuchMethodException x) {
                   x.printStackTrace();
              } catch (IllegalAccessException x) {
                   x.printStackTrace();
              } catch (InvocationTargetException x) {
                   x.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
    2 - create a .bat file:
    @echo off
    java -cp C:\Downloads\Marcxml\marc4j.jar; C:\Downloads\Marcxml\marcxml.jar; Executer %TARGET_CLASS% %IN_FILE% %OUT_FILE%3 - use set command to pass variable:
    Open MS-DOS, and type the following:
    set TARGET_CLASS=MyTargetClass
    set IN_FILE=in.txt
    set OUT_FILE=out.txt
    Then run your .bat file (in the same ms dos window)
    Hope that Helps

  • Pass return code from Java application to a .bat file.

    I have a .bat file which will execute a Java application. I want to pass the return code from the java application to the ".bat" file.
    Could you please let me know, how can I accomplish this.

    I tried that, but it doesn't return the value...
    In my Java app, I had System.exit(returnCode) and in the '.bat' file
    I have
    @echo off
    java <myApp>
    set returnCd=%?%
    echo %returnCd
    and it didn't return any value. What should I specify in set returnCd=%?% instead of ?

  • Passing parameter values to powershell function from batch file

    Hello ,
       I haven't used powershell for a while and getting back to using it. I have a function and I want to figure out how to pass the parameter values to the function through batch file.
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    <#
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_011.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    #>
    The above code seems to be work when I call it. But when I try to call that script and try to pass the parameter values, I am doing something wrong but can't figure out what.
    powershell.exe -command " &{"C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"}"
    Write-Host "ReturnCode : $returncode"
    $file = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    powershell.exe -file "C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile $datafile
    Somehow the I can't get the datafile parameter value being passed to the function. Your help would be much appreciated.
    I90Runner

    I am not sure about calling a function in a script like how you want to. Also I see you are setting the values of the parameters, this is not needed unless you want default values if nothing is passed. The values for the parameters will be passed via the
    batch file. So for me the easiest way is as indicated.
    param
    [string]$DataFile
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    Write-Host "Return Code: $(Check-FileExists $DataFile)"
    Then you create a batch file that has
    start powershell.exe
    -ExecutionPolicy
    RemoteSigned -Command
    "& {<PathToScript>\MyScript.ps1 -DataFile 'C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile.txt'}"
    Double click the batch file, and it should open a powershell console, load your script and pass it the path specified, which then the script runs it and gives you your output
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Run a script from batch file

    Hi All,
    I want to execute a SQL script that runs from a batch file.
    Lets say, I have loader.bat file. This .bat file connects to Oracle and wants
    to execute .sql file
    The content of loader.bat file is
    sqlplus
    @C:\temp_val_id.sqlAt run time it ask to userid and password. I enter the username and password and then get connect to Oracle
    But the temp_val_id.sql file is not exectuted.
    The output is as below, but .sql file is not executed
    C:\>sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 17:19:50 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter user-name: utest_tt_senayat/password@silver3
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>I am now trying a different method
    sqlplus
    @@C:\temp_val_id.sqlThe output is the same as above. Not executing temp_val_id.sql
    Could someone please assist me,
    Thanks in advance
    Saaz

    Saaz Ena wrote:
    sqlplus /nolog @test.sql
    content of test.sql:
    connect &user/&pass
    select sysdate from dual;
    exit;
    C:\work\test>sqlplus /nolog @test
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 16:21:12 2012
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter value for user: system
    Enter value for pass: manager
    Connected.
    SYSDATE
    28-MAR-12
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

Maybe you are looking for

  • Power Mac G4 Wake from Sleep Crash

    I have been having wake from sleep issues since I installed Mac OS 10.5 on my Power Mac G4 three months ago. Technically, this machine is supported by Leopard: it's an 867 MHz G4 with 512 MB of RAM. And indeed, the Leopard installer allowed me to ins

  • Deleting Songs from Nano 7 - Problems!

    What should be a simple matter is made so complex by Apple that it is pure torture.  Why is it so complicated to delete songs from Nano 7? I've tried the "uncheck the boxes" and re-sync nonsense.  Yes, it got rid of some songs -- but it ADDED songs I

  • Difference between $29 upgrade disk and the $9.95 Up to Date Disk

    Could someone tell me if there is a difference between the two? I qualified for both as I just purchased a new MacBook Pro 2 weeks ago and I have a MacBook purchased last year as well. Justwondering if there is any difference. Thanks, Jenny

  • T510 win7 x64 ThinkVantage Toolbox does not function

    This is my first Lenovo after years of Dells. Normally I would junk the preloaded non microsoft bloatware just to be confident that I knew what was going on. However the ThinkVantage Toolbox might seem to be a useful free utility, but out of the box

  • Smart Object woes!

    Most serious users have been greeted by Smart Object bugs. They're frustrating. Check this one out. http://feedback.photoshop.com/photoshop_family/topics/smart_object_rendering_bug?rfm=1 Ever happen to you? What causes it?