How to close a running exe through java code

hai friends,
i need to close a running exe file through code...
i tried
Runtime r;
Process p;
try {
            r = Runtime.getRuntime();
            p=r.exec("d:\\aaa");
        } catch (IOException ex)
p.destroy();but its not closing the application properly...
pls anyone help me

ksnagendran26 wrote:
how to exit the application which is running in quick launchWell my guess, since you are not providing specific information, is that java is in fact closing the application that it ran. What you are seeing is some other application that was spawned by whatever it is that you did. And java isn't going to close that because it doesn't even know it exists.

Similar Messages

  • Invoke exe through java code(using java.lang.Runtime)

    Iam trying to invoke an exe from java code.If i give the complete path for that exe it is running fine .But if i set the environment variable and directly execute the exe through command prompt it iss running fine , but it fails to run when i do the same using java code i.e. java.lang.Runtime.exec function

    Give "//" for directory seperator.
    E.g. r.exec("c://test//test.exe",null);
    Why? That doesn't look correct.It is correct. It will work fine. Try it out.But it doesn't add or solve anything. A forward slash
    does not need to be escaped.'
    It's not even escaping. It's just doubling up. If that works, I'd bet "C://///test///////test.exe" does also.

  • How to update OID oblogintrycout attribute through java code

    Hi Team,
    As per my requirement ,i need to update OID oblogintrycout attribute through java code. could you please help me on this.
    where can i get the java code.
    Regards,
    Ravi.

    As always, Google is your friend.
    Follow the bouncing link.
    http://www.google.com/search?hl=en&q=VisualSourceSafe+%2B+Java+API
    PS.

  • Running windows command through java code

    Hello
    i want to execute jar.exe through java code , i have written following piece of code , but it isn't working
    ProcessBuilder processBuilder = new ProcessBuilder(new String[]{"cmd.exe","/c","%java_home%\\bin\\jar.exe"});
              Process process = processBuilder.start();
              BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
              String line = inputReader.readLine();
              while(line != null){
                   System.out.println(line);
                   line = inputReader.readLine();
    does anybody knows why
    Regards
    Edited by: Mayur Mitkari on Mar 5, 2013 10:19 PM
    Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM
    Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM

    sorry for that , but the
    Runtime runtime = Runtime.getRuntime();
              Process proc = runtime.exec(new String[]{"cmd.exe","/c","jar"});
              proc.waitFor();
    int i = proc.exitValue();
    this code was different from first one
    and in case of Process if runtime .exec is succesful it is wainting for long time , in this case i want if the runtime.exec is succesful something should be returned
    Regards

  • Trying to install Adobe Premiere elements 12.  When it gets to "Installing required Shared Technologies" stage it gives errror "Setup has detected that Adobe Bridge CS5 (Bridge.exe) is currently in use.  Please close all running exe(s).  Nothing is runnin

    question:  Trying to install Adobe Premiere elements 12. When it gets to "Installing required Shared Technologies" stage it gives errror "Setup has detected that Adobe Bridge CS5 (Bridge.exe) is currently in use. Please close all running exe(s). Nothing is running when trying to install this, have been through this process several times. Found undertroubleshooting to delete files PDAppFlex.swf and PDAppFlex-app.xml and have done that as well. Any help will be greatly appreciated

    Try Error "Installation cannot continue until... Adobe Bridge is closed" | Installation | CS5

  • How to clear the DOS screen through java program

    how to clear the DOS screen through java program

    Just some Friday fun. Use the telnet program that comes with Windows and supports VT escape sequences.
    import java.io.*;
    import java.net.*;
    public class AutoTelnet {
         private static Socket s;
         public static void main(String[] args) throws Exception {
              Thread t = new Thread() {
                   @Override public void run() {
                        try {
                             s = new ServerSocket(5555).accept();
                        } catch (IOException ex) {
                             ex.printStackTrace();
              t.start();
              Process p = new ProcessBuilder("cmd", "/C", "start", "telnet", "127.0.0.1", "5555").redirectErrorStream(true).start();
              t.join();
              PrintStream ps = new PrintStream(s.getOutputStream());
              ps.println("Screen will be cleared in 5 seconds");
              ps.println("5");
              Thread.sleep(1000);
              ps.println("4");
              Thread.sleep(1000);
              ps.println("3");
              Thread.sleep(1000);
              ps.println("2");
              Thread.sleep(1000);
              ps.println("1");
              Thread.sleep(1000);
              ps.println("\u001b[2J");
              Thread.sleep(5000);
    }

  • How to create an Oracle DATABASE through Java Programming Language.. ?

    How to create an Oracle DATABASE through Java Programming Language.. ?

    Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
    In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
    So a certain amount of manual installation will always be required.
    Typically you would supply the SQL scripts, and a detailled installation document too.
    regards,
    Owen

  • How to Increase Java Heap Size through Java Code. Increase inside Code?

    Hi All,
    I am using a third party tool. When i run a particular program it says OutOfMemory error. I like to increase heap size through Java Code before calling the particular Java application or Code..
    Is there is any way to set the Heap Size through Java Code in run time ???
    Pls Kindly help.
    Thanks.

    if you start the program with a -Xmx512m flag, the virtual machine gets half a gigabyte of memory to use (or that's the max it's allowed to use). All things run in the same virtual machine will have the same limit, third party tools run in the same virtual machine can't "not care about this" unless they're throwing OOMs themselves for some stupid reason.

  • How to find IP allocated to windows OS through java code

    Hi,
    I want to find no of IPs allocated to windows OS through java code. How i can do this.Please give me idea.
    any help will be appricated.
    Thanks in advance
    Ravi Adha

    You can use the InetAddress class in the java.net package to find all the IP addresses of your computer.

  • How do I trigger an Oracle report through Java Code?

    Hello,
    I am new to reports. Is there any way to trigger a report through java code - I know there is an OS command to trigger a report automatically. Has anybody done this through a high level PL?
    Amit

    We are in a similar situation. If you receive any answers can you forward the same to [email protected]

  • How to manage logging in weblogic through Java Programme.

    Hi Experts,
    I want to added logging to weblogic server(Admin Server and 3 Managered Servers) using java code.Is it possible?
    I have an admin server and some 3 managed servers.I want to added a logging suppose for org.springframework package to see debug message .So I want to do that,through java code(out side weblogic with a main method) for my admin server and managed servers.
    Please guide me through some example.
    Regards
    Rocks-Raja
    Edited by: user3466330 on Feb 13, 2013 11:09 AM
    Edited by: user3466330 on Feb 13, 2013 11:15 AM

    Thanks Lauri, it takes me to another aspect of creating the presentation I had not discovered.  I did find my own way to "calibrating the colour", and succeeded by watching the adjustments to the image on the projection screen to match my desktop, rather than by following exactly the steps described in the instructions.

  • Need to track windows processes through java code.

    Need to track windows processes through java code.
    Eg: I want to find out whether an exe file (wrun.exe) is running or stopped.
    Can I do it through java. If so can any one please tell me how to do it. That will be a great help.
    Thanks,
    Ramesh

    There are 2 options for things like this:
    1) Use Runtime.exec() to execute some command or application and parse the input from it.
    2) Write some native code and use JNI to call it.

  • Opening a word file in MS Office Word software window through Java code

    I want to open a word file in MS Office Word software window through Java code.
    Is it possible ? If possible then please let me now how can I do it.
    Bhoopender

    Thanks for replying.
    I tried the following code -
    public class OpenFileWithItsExt
         public static void main(String[] args) throws java.io.IOException
              Runtime.getRuntime().exec("a.doc");
    and it gets compiled successfully, but on running outputs as -
    Exception in thread "main" java.io.IOException: CreateProcess: a.doc error=193
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:66)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:566)
    at java.lang.Runtime.exec(Runtime.java:428)
    at java.lang.Runtime.exec(Runtime.java:364)
    at java.lang.Runtime.exec(Runtime.java:326)
    at OpenFileWithItsExt.main(OpenFileWithItsExt.java:5)
    My file is in the pesent working directoty.
    Please solve my problem.
    Thanks

  • 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

  • Adding rows to J2ME WTK/Settings/User Defined (through Java code)

    Hi all..
    Just a quick question..
    Is it possible to add Key/Value pairs to a MIDlet's 'User Defined' field through Java code..(ie) - add a new row to the User Defined field..
    If not, can anyone tell me how a Bluetooth-Client GUI can save an image it has been sent by a Bluetooth-Server GUI?
    Thanks in advance..
    Rookie

    if i understand you, you want to call application module method when user clicks on add button on the UI and your table is from VO
    so what i can come up for now is:
    1) create variable binding from the iterator for both name and price.
    2) on your UI action button :
    <af:commandButton actionListener="yourbean.addToCart">
    <f:attribute name="pName" value ="binding.<created name bind variable>"
    <f:attribute name="pPrice" value = "binding.<created price bind variable>"
    </af:commandButton>
    3) custom Managed Bean:
    //yourBean.java
    public void addToCart(ActionEvent e){
    // get binding here
    // use executeWitParams method to send parameter to the function "testMethod" and execute
    //AppModuleImp.java
    public void testMethod(String pName,String pPrice) {
    CardVOImpl vo = this.getCartVO1();
    CardVORowImpl r = (CardVORowImpl)vo.createRow();
    r.setAttribute("NAME", pName);
    r.setAttribute("PRICE", pPrice);
    vo.insertRow(r);
    Hope this helps...
    Let me know if not..
    Thanks
    Edited by: MavenDev on Oct 30, 2011 8:08 PM

Maybe you are looking for

  • How much hard disk space remains?

    Sorry, the Missing Manuel for Lion isn't available until the end of the month, but I have a lot of basic questions. With Snow Leopard when i opened a Finder window at the very bottom of the window pain was information on how much memmory was being us

  • Trying to make a logarithmic Category axis - is this impossible?

    I'm trying to keep my y-axis linear and my x-axis logarithmic on a simple line chart – is this impossible, for some reason? I see no mention if it in the documentation, and I've spent hours trying to figure it out. It seems odd that it'd be so easy t

  • Is it possible to use EBS as a ETL tool ?

    Is it possible to use EBS as a ETL tool ?

  • How do I get the registration nag screen to go away permanently?

    I purchased Acrobat Pro 7 while an employee, and now that I'm retired, I have neither the money nor need to upgrade. However, I did get a W8 machine, and when I tried to install Acrobat, I needed a new link, which I received from Adobe. I downloaded

  • Safari 7 PDF Zoom Level

    Since upgrading to Mavericks Safari no longer remembers my previous PDF zoom level.  I am using Safari's build in PDF viewer, not Acrobat.  Prior to Mavericks Safari would remember my last zoom level (I prefer Actual Size).  Now PDF's always open in