Bat files

Does anyone know how to run a .bat file from within a pl/sql script or trigger. I am using oracle 8.1.6 on windows 2000
THnaks in advance

You can do it with java
Simply write a java procedure that executes the .bat file.
Good luck
Remi
http://askremi.ora-0000.com

Similar Messages

  • Running a Bat file from a stored procedure

    This is part II of Re: Need to run bat file from application express
    I thought I would open a new thread
    I thought I had this fiqured out but it still doesn't work
    1) I granted CREATE EXTERNAL JOB to my user
    2) startup the OracleJobScheduler Service
    3)
    create or replace
    PROCEDURE RUN_OS_COMMAND(p_cmd IN varchar2)
    is
    v_job_exists pls_integer:=0;
    begin
      select count(1)
      into  v_job_exists
      from  all_scheduler_jobs
      where job_name='JAVA_EXE';
      if v_job_exists>0 then 
        dbms_scheduler.drop_job(job_name =>'JAVA_EXE');
      end if;
      dbms_scheduler.create_job
      (   job_name          =>'JAVA_EXE'
        , job_action        =>p_cmd
        , job_type          =>'executable'
        , enabled           =>false
        , auto_drop         =>false
        , start_date        =>systimestamp
      dbms_scheduler.run_job(job_name =>'JAVA_EXE');
    end;test.bat is del test.csv
    I run this
    begin
      RUN_OS_COMMAND('C:\temp\test.bat');
    end;
    / anonymous block completed
    It runs with no errors but does not run the bat file... what am i missing, thanks Doug

    LLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\wblincoe\Application Data
    CLASSPATH=.;[ORACLE_HOME]\jdbc\lib\ojdbc6.jar;c:\myjar\xdocore.jar;c:\myjar\i18nAPI_v3.jar;c:\myjar\xdoparser.jar;c:\myjar\xmlparserv2.jar
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=WBLINCOELT
    ComSpec=C:\WINDOWS\system32\cmd.exe
    DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\wblincoe
    LDMS_LOCAL_DIR=C:\Program Files\LANDesk\LDClient\Data
    LOGONSERVER=\\03N-DAYT-DC01
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:\OraHome_1\jre\1.4.2\bin\client;C:\OraHome_1\jre\1.4.2\bin;C:\app\wblincoe\product\11.1.0\db_1\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    PERL5LIB=C:\oracle\product\10.2.0\http_1\sysman\admin\scripts;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1\lib;C:\oracle\product\10.2.0\http_1\perl\site\5.6.1;C:\oracle\product\10.2.0\http_1\perl\5.6.1\lib\MSWin32-x86;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1;C:\oracle\product\10.2.0\http_1\perl\lib\5.6.1\MSWin32-x86;
    PHPRC=C:\Program Files\PHP\
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0f02
    ProgramFiles=C:\Program Files
    PROMPT=$P$G
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    TMP=C:\DOCUME~1\wblincoe\LOCALS~1\Temp
    USERDNSDOMAIN=CACI.COM
    USERDOMAIN=CACI
    USERNAME=wblincoe
    USERPROFILE=C:\Documents and Settings\wblincoe
    VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopProtection
    windir=C:\WINDOWS

  • HELP:: Flash unable to open BAT file or PPT file

    HELP Please....
    I am using Flash MX.. my projector exe file doesnt seem to
    open/call
    "myppt.bat" file which calls a powerpoint (PPS) file after
    the animation is
    over. The bat file runs well when
    self executed but not from flash...
    I also installed the trial version of Flash 8 and seem to be
    having the same
    above problem.
    please help by providing a working solution.

    Use FlashJester JStart
    http://jstart.flashjester.com
    p.s Beware, a double posting is not seen too good..
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. -
    http://www.flashjester.com
    There is a very fine line between "hobby" and
    "mental illness."

  • Reading the registry from a .bat file

    I've searched a bit on web before asking and I apologies a head of time but my knowledge of .bat files is a little lacking. Currently I have a working .bat file I created, but was looking to adding something extra to it and just can't seem to find exactly
    what I need.. What i'm looking to do is at the top of .bat file I want it to read the registry here HKEY_LOCAL_MACHINE\SOFTWARE\IS_DEPT\Simage\HW\Platform
    Under Platform we either have 2 types LT or DT. (laptop or desktop)
    What I want to do is at the top of my bat file have it search this key. If it has the value LT I want it to continue on with the script. If the value is DT I want it to not run the rest of the script and go to :end
    If this is possible can someone provide me with the commands to put at the top of the script with also the IF commands to continue or go to :end

    Thanks for you reply but I'm still a little lost with the reply.
    What is the rest of the commands?
    I understand this will query the registry, but what about searching for "LT or DT" and the IF/GOTO Commands?
    reg query HKEY_LOCAL_MACHINE\SOFTWARE\IS_DEPT\Simage\HW\Platform
    I think my confusion is how to define LT or DT as the variable. I keep finding %errorlevel%  variable, but that seems to only define on (1) or off (0)
    Here's what I have so far and I dont' think it's correct.
    reg query HKEY_LOCAL_MACHINE\SOFTWARE\IS_DEPT\Simage\HW\Platform /f
    if "%ERRORLEVEL%" == "LT" GOTO HOME
    if "%ERRORLEVEL%" == "DT" GOTO NOOOOPE

  • Firefox Does Not Open a Link Pointing to a .bat file on a the network drive on local website

    Make and model of network drive?
    --HP Priliant DL580 G5
    How is you network set up?
    --Novell Netware 6.5
    What router are you using?
    --Cisco router c3825
    What are you trying to do with the batch file?
    --simple program that launches a batch file that is in the network drive
    Interent Explorer shows the following when launching the link.
    >File Download-Security Warning
    >do you want to run or save this file?
    >Name: johndoe.bat
    >Type: MS-DOS Batch File, 308 bytes
    >From T:\xx\xxxbat
    Has this worked in previous versions of FireFox?
    >no and it does not work with newer v11.
    Whats the issue with using IE if it works from IE?
    >we have users that use FF on regular bases and just for a link to switch browser it is not user friendly. all though we are supporting two browsers we do not want to take FF out of network.
    Is there a reason you want to use FireFox?
    >FF has gained popularity in our agency and it would be best to have this link work on FF as well.
    --HERE IS THE CODE--
    <td valign="top"><a href="file:///T:/Geosupport Desktop Edition/bat/Goat.bat"
    type="application/bat" target="_blank"><img src="../../images/technology/Goat.gif" alt="Goat" width="32" height="28" hspace="4" vspace="2" border="0" align="left"></a>Geosupport On-Line Address Translator, or GOAT, is an interactive Windows application that allows the user to request geographic data through Geosupport function calls. Use of GOAT requires no programming skills and provides valuable information to the casual user.<br>

    Firefox sees that (at least local or network dive located) .bat files are text and renders them as such. To download it as a .bat file, use save page as, (or Control-S) change "text file" to "all files" and type .bat onto the end of the filename, then hit save. Not ideal I know, but better than nothing.

  • Using a .bat file to use Values in Registry from another Registry

    I recently starting working in an IT Department and for years my superiors/co-workers have always had a piece of software called "cyt.exe".
    When ever I logged in someones computer as Admin, this software allowed me to log out with their username still in the log in text box. We recently upgraded a large quantity of systems to Wins7 and WinEmbedded7 and that program no longer works due to the
    registry change.
    Currently the best I could to for replicating that software function as .bat file is:
    call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnSAMUser /t REG_SZ /d "domain/username" /f
    call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnUser /t REG_SZ /d "doamain/username" /f
    pause
    When I log out, it leaves the user name and password blank which is OK but I need to take it one step further. I need the values of:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI
    "LastLoggedOnSAMUser"="domain\username"
    "LastLoggedOnUser"="domain\username"
    to match the values that are in
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData\1
    "LoggedOnSAMUser"="domain\username"
    "LoggedOnUser"="domain\username"
    Any suggestions on what I need to change in my code to manipulate the registry to match those values without having to manually input them?

    - Vegan Fanatic
    "can you fix the cyt.exe program, that would be the best option long term"
    Well the cyt.exe program hasn't been updated since 2000 (version 2.3 and 2.5 were the latest versions) so I can only assume the developer has abandoned the project. The reason why it doesn't work anymore is because of the registry change going from XP to
    Vista/Win7/Win8.
    Once I have my own batch file, it will be easier to tweak it as needed when an operating system changes then it is to rely/wait on someone else to update a very specific piece of software that only has one small purpose that has most likely been forgotten.
    As much as I would like to modify the existing program, I don't have any software I can use to re-program it and I doubt I have enough knowledge or experience to tweak it correctly.
    - Frederik Long
    "You need to experiment either with reg query / reg add or reg export / reg import. Each of these commands has inbuilt help, e.g. reg import /?."
    From what I tested, the export/import copies the file and its values and placed them where I asked it too. That is not what I need. I need the values ONLY and placed within the file I need which has a different name from the file I exported from.

  • How can I use an java based app that starts via an inf or bat file?

    I have java exe application that is started using a .bat file and a java exe application that is started using an inf file. Both the .bat and inf prevent the respective application from kicking off.  Is there a way to convert these file types so that they execute on  my MacBook?

    I didn't expect you to have your customer run the command. I would expect you to create the executable and install it. However, there wouldn't be any difference in what you are creating and the .jar file. Either way it is a faceless icon. For that matter, it is no different than a batch file on Windows. I'm not sure what they wouldn't understand with, "copy the Vocab.jar file to wherever you want and double-click it to run the program." In addition, you probably ought to point out that Java is not installed on Mac OS X Lion (10.7.x) and when they double-click the jar file (or whatever you send them), the system will ask if they want to install Java.
    What you really need to do is package up the app inside a Mac application package and provide the user with the application on a .dmg (disk image). Take a look here: http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Jar_Bundle r/Introduction/Introduction.html#//apple_ref/doc/uid/TP40000884
    I also found this which uses ANT to create the bundle: http://informagen.com/JarBundler/

  • Can anyone help me rewrite a .bat file to work on my iMac?

    I need some help writing these .bat files so i can use them on my mac
    @echo off
    @title Dump
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ tools.wztosql.DumpItems
    pause
    //new file
    @echo off
    @title Dump
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar;dist\bcprov-jdk16-145.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ tools.wztosql.DumpMobSkills
    pause
    //new file
    @echo off
    @title Dump
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar;dist\bcprov-jdk16-145.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ tools.wztosql.DumpQuests
    pause
    //new file
    @echo off
    @title Lithium Server Console
    set CLASSPATH=.;dist\Lithium.jar;dist\mina-core.jar;dist\slf4j-api.jar;dist\slf4j-j dk14.jar;dist\mysql-connector-java-bin.jar
    java -server -Dnet.sf.odinms.wzpath=wz/ server.Start
    pause
    Thank you very much, im sorry if i seem very ignorant by asking this, i just dont know applescript and im trying to get this done as fast as possible.

    Try the developer forums:
    https://discussions.apple.com/community/developer_forums

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to call a java class in a bat file

    Hi
    I need to call a Test.java class in a bat files .It refer .DOM.jar
    in C:/url; How do i call the java class i need the syntax
    Thanks lot

    assuming lanch.bat, Test.class and DOM.jar are in c:\url
    assuming %JAVA_HOME% is defined (else substitue it with your java installation directory)
    here is the content of launch.bat:
    cd C:/url (or cd c:\url ) (or cd c: followed by cd url)
    %JAVA_HOME%\bin java -classpath .;DOM.jar Test
    hop that'd help,
    marvinrouge

  • Getting error while running ua.bat file of Oracle Data Integrator 12cR1 (12.1.2.0.0) version

    Hi,
    I am using windows 7 professional(service pack 1) 64 bit operating system.
    After installing the odi 12c (enterprise edition) by executing the odi_121200.jar file I am getting the following error while trying to run the ua.bat file.
    [2013-10-24T16:49:07.861+05:30] [Framework] [INCIDENT_ERROR] [UPGAST-00056] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] error initializing upgrade plug-in for ODI.ODI1
    [2013-10-24T16:49:07.861+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Cause: An unexpected error occurred initializing an upgrade plug-in.
    [2013-10-24T16:49:07.861+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Action: Contact Oracle Support Services.  See the secondary error message for additional details.
    [2013-10-24T16:49:07.861+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] [[
    java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at oracle.ias.update.plugin.Plugin.instantiatePlugin(Plugin.java:248)
      at oracle.ias.update.plugin.Plugin.<init>(Plugin.java:229)
      at oracle.ias.update.plugin.Plugin.getPlugin(Plugin.java:180)
      at oracle.ias.update.plan.PlanStep.getPlugin(PlanStep.java:335)
      at oracle.ias.update.plan.PlanString.<init>(PlanString.java:66)
      at oracle.ias.update.plan.PlanCustom.<init>(PlanCustom.java:74)
      at oracle.ias.update.plan.PlanStep.<init>(PlanStep.java:189)
      at oracle.ias.update.plan.PlanComponent.<init>(PlanComponent.java:203)
      at oracle.ias.update.plan.Template.load(Template.java:161)
      at oracle.ias.update.plan.Template.loadAllTemplates(Template.java:102)
      at oracle.ias.update.UpgradeDriver.loadConfiguration(UpgradeDriver.java:838)
      at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:257)
      at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:175)
    Caused by: java.util.MissingResourceException: Can't find oracle.ias.update.plugin.odi.bundle.ODIResourceBundle bundle
      at java.util.logging.Logger.setupResourceInfo(Logger.java:1518)
      at java.util.logging.Logger.<init>(Logger.java:265)
      at java.util.logging.Logger.<init>(Logger.java:260)
      at oracle.ias.update.UpgradeLogger.<init>(UpgradeLogger.java:60)
      at oracle.ias.update.UpgradeLogger.getLogger(UpgradeLogger.java:93)
      at oracle.ias.update.LoggingManager.create(LoggingManager.java:249)
      at oracle.ias.update.plugin.UpgradePlugin.createPluginLogger(UpgradePlugin.java:195)
      at oracle.ias.update.plugin.UpgradePlugin.<init>(UpgradePlugin.java:181)
      at oracle.ias.update.plugin.odi.ODIPlugin.<init>(ODIPlugin.java:136)
      ... 17 more
    [2013-10-24T16:49:07.869+05:30] [Framework] [ERROR] [UPGAST-00259] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] The getInitialValue method for plug-in ODI.ODI1 will not be called due to a previous error.
    [2013-10-24T16:49:07.869+05:30] [Framework] [ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Cause: An error occurred when loading or initializing the plug-in which prevents the getInitialValue method from executing.
    [2013-10-24T16:49:07.869+05:30] [Framework] [ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] Action: Review the log file for additional details.
    [2013-10-24T16:49:07.870+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] UPGAST-00251: An error occured reading Upgrade Descriptor file ODI\INSTALLATION\odi12cInstallation_1\odi\plugins\upgrade\odi.xml
    [2013-10-24T16:49:07.870+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] The file does not conform to the expected syntax.
    [2013-10-24T16:49:07.870+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] See the secondary message for additional information. Contact Oracle Support.
    [2013-10-24T16:49:07.871+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] UPGAST-00259: The getInitialValue method for plug-in ODI.ODI1 will not be called due to a previous error.
    [2013-10-24T16:49:07.871+05:30] [Framework] [INCIDENT_ERROR] [] [upgrade.Framework] [tid: 1] [ecid: e9250ad8-50dc-45fe-83f5-5c01e7a7dcb4-00000001,0] [[
    oracle.ias.update.exception.UpgradeException: UPGAST-00259: The getInitialValue method for plug-in ODI.ODI1 will not be called due to a previous error.
      at oracle.ias.update.plugin.Plugin.getInitialValue(Plugin.java:317)
      at oracle.ias.update.plan.PlanString.<init>(PlanString.java:67)
      at oracle.ias.update.plan.PlanCustom.<init>(PlanCustom.java:74)
      at oracle.ias.update.plan.PlanStep.<init>(PlanStep.java:189)
      at oracle.ias.update.plan.PlanComponent.<init>(PlanComponent.java:203)
      at oracle.ias.update.plan.Template.load(Template.java:161)
      at oracle.ias.update.plan.Template.loadAllTemplates(Template.java:102)
      at oracle.ias.update.UpgradeDriver.loadConfiguration(UpgradeDriver.java:838)
      at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:257)
      at oracle.ias.update.UpgradeDriver.main(UpgradeDriver.java:175)
    Thanks and Regards
    Sunil

    ok - I think I've got it figured.  Appears to be a known issue.  You need to apply patch p17073913_121200.
    I downloaded that and applied to my Linux version - then re-ran the UA.  This time the GUI started and so now I'm going through the upgrade steps.
    The patch is generic, so should work for your windows environment too.  Good luck.

  • Error when running a bat file

    Can someone tell me what this error means; "ORA-12560: TNS:protocol adapter error"
    I had Oracle XE on my Windows XP Pro SP3, but I also install the EE of Oracle which I haven't setup yet. Originally when I run this .bat file by double clicking on it, "setup_distran_database.bat", everything worked fine. But now, I am getting tghe above error. Not sure if it was because I installed Oracle EE.
    This is the .bat file:
    *@ECHO off*
    *:: Ayo Ojikutu*
    *:: Using Murach's Oracle SQL and PL/SQL*
    *:: and Mike Murach & Associates, Inc. example*
    *:: Nov 11, 2011*
    *:: Uses SQL*Plus utility to run the SQL scripts that create*
    *:: and populate the tables in the AP, OM, and EX schemas.*
    *:: If necessary, edit the username/password*
    sqlplus system/passwordhere @setup_distran_database*
    *:: Display a message about the log file*
    ECHO.
    ECHO For details, check the setup_distran_database.log file in the current directory.
    ECHO.
    *:: Display 'press any key to continue' message*
    PAUSE

    "ORA-12560: TNS:protocol adapter error"
    Not sure if it was because I installed Oracle EE.Most probably yes, Windows has the last installed product environment. Try setting XE environment before running sqlplus, something likeset ORACLE_SID=XE
    set ORACLE_HOME=<XE Oracle Home>
    set PATH=<XE Oracle Home\bin>;%PATH%
    sqlplus .....

  • Trying to run a bat file from oracle

    I have followed these steps, see bottom for results, everything is valid but the bat file does not run???? PLease need your help. Doug
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "getbatx" AS
    class getbatx //class pdfopen
    public static void execmd(String c) //main function
    try
    System.out.println("Executing:" + c);
    Runtime.getRuntime().exec("C:\\WINDOWS\\system32
    cmd.exe /c "+c);
    System.out.println("Executing:" + c + " ...done");
    } catch (Exception e) //catch any exceptions here
    System.out.println("Error" + e ); //print the error
    CREATE OR REPLACE PROCEDURE host_command2 (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'getbatx.execmd (java.lang.String)';
    /Then as sysdba I put in in the following.
    exec dbms_java.grant_permission( 'CAPRS', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' );
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');Then I make the call.
    SET SERVEROUTPUT ON SIZE 1000000
    CALL DBMS_JAVA.SET_OUTPUT(1000000);
    BEGIN
    host_command2 (p_command => 'c:\mybook.bat');
    END;
    /***** I run this, it completes but does not run the bat file and there is no error message
    SQL> BEGIN
    2 host_command2 (p_command => 'mybook.bat');
    3 END;
    4 /
    Executing:mybook.bat
    Executing:mybook.bat ...done
    PL/SQL procedure successfully completed.

    Yes it should open a dos box, but you forgot to add the .bat file witch you like to run: String[] command = {"cmd", "/c", "start", "c:/Batch files/Cardiobackup/cardiobackup_v1.4"}

  • Execute SSIS Package from JOB which contains Execute Process Task calling a .bat file

    Hi All,
    I have a EXCEL Macro needs to be called from SSIS. We could not use Script task because of some internal reason.
    So we have taken an approach to call a .BAT file using Execute Process Task. This .BAT file will call a .VBS file which will execute the EXCEL Macro.
    The SSIS Package is running good if I execute the package from BIDS.
    But the real problem is with the scheduling this SSIS Package using SQL JOB.
    If i execute this SSIS package from SQL Server Job, its executing the whole package successfully except the Execute Process Task.
    So the overall issue is SQL Server Job is not executing properly if I call any .BAT file from the SSIS Package.
    Please give me suggestion to get rid of the issue. Thanks in advance.

    Hi Sai.N,
    If you run the SQL Server Agent job manually from SSMS, does the package execute properly? If the package executes properly when you run the job manually, the issue should occur due to permission issue. In this case, I suggest that you create a SQL Server
    Agent proxy based on the current Windows account which you use to log onto the operating system, and run the job under the proxy account.
    If it is not the issue, please enable logging in the package as Visakh mentioned and post the warning/error message for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • Error while deployment BAT file

    When deployment BAT file i have an error with description "1" and Message ID "10006". Therefore bat file has been successfully executed on client computer.
    The customer asks reports of deployment so i can't show report with errors only))
    Can anybody give an advise with this situation?
    If answer is helpful, please mark as answer or hit the green arrow on the left.

    If you are using the application model, you can add return code 1 as a success in the
    Return Codes tab of the deployement type. If not you can catch the exit code 1 in your batch file and return a 0 instead.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Running Oracle startup or shutdown bat file from Java code

    I have two bat files for the startup and shutdown of Oracle instance which works fine from the command prompt. But my requirement is to run it through a Java program. Please reply with full Java code. Also mention how I would get the status of the bat files that it is successfully executed or not and if not what is the error.

    Your program is working fine, but there is another problem. What's happening now is I have to open the Login screen after the startup of oracle server is complete, but the next line of my program after Runtime.exec is the LoginScreen.show which immediately shows the login screen after executing Runtime.exec and when I am giving the login name and password and press enter, it shows Oracle not available exception, because the startup process is still in progress. I want to stop the execution of my next line of code until and unless my process of Oracle startup is complete.

Maybe you are looking for

  • Add loops to Arrange without sync Pitch and Tempo

    I recently purchased a package of Audio loops. This package contained audio files in wav and AIFF format. I tried to add the AIFF loops to Loop browser and Logic but it didn't work. The pitch of the loops would change as I dragged them toward the arr

  • How to find the value of date char used as exception aggregation reference

    Hi BI Gurus, On a BEx report I need to list three things by material: 1)   the open (not yet delivered) Purchase Order quantities 2)   the PO quantity to be delivered next and 3)   the date that belongs to the next delivery The model supports these d

  • Error While Installing Cluster on Windows ECC 6.0 SR3

    Hi All, We are doing ECC SR3 cluster installation with DB2 9.1 on windows 2003 server. We have successfully completed ASCS,SCS & First cluster node installation. we are getting error while DB2 Instance installation in step , configuring the database

  • ITunes movies with no storage left on Macbook air

    Where can I put my Itunes movies if i have no storage on my mac? Itunes movies are taking up to much space, so can I move them somewhere? Or if i delete them, and get a Mac Desktop, will they be able to be redownloaded? I need the space for other thi

  • Can I set all device calendar entries to be set private by default?

    I would like all calendar items entered on my 8900 to be automatically defaulted to the "private" setting. Is there a way to accomplish this? Thanks for any help!