Follow up question in running *.exe files in java

Is it possible to run a *.exe program in java by launching it? I mean I have an interface and there will be a button or link that will launch the *.exe program can u guys help me on what can I do? thank you very much for your help...

You could look up the various exec() methods of the Runtime class.

Similar Messages

  • Can we run EXE file/ Another Java Program from Java Application? How?

    Can we run EXE file and another java program from java application?
    Thanks in advance

    Example running adobe acrobat
    String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
    Runtime rn = Runtime.getRuntime();
    Process process = rn.exec(command);
    process.waitFor();rykk

  • Running exe files from java applications

    Hello All,
    Is it possible to run executable files from java applications?
    I need to run an exe file on the client from the server machine, the exe could reside on either the server or any other machine on the LAN. Is it possible to specify the path of where the exe resides, and run it on a client machine?

    HI,
    I tried to launch a MS Word application using runtime.exec but it gives me some problem
    The foll. code to launch a txt file using notepad works.
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = {"notepad.exe","C:\\coo7\\wizard.txt"};
    Process child = rt.exec(callAndArgs);
    However, oif I try to launch a MS Word application, it asks for the entire path of WINWORD.exe, (unlike just specifying notepad.exe as the first argument in String[] callAndArgs) and this can vary from one machine to another.. how do I get around this?
    The foll. code snippet works but the complete path of where WINWORD.exe might be installed on any machine, is not fixed:-(
    Runtime rt = Runtime.getRuntime();
    String[] callAndArgs = {"C:\\Program Files\\Office\\Office10\\WINWORD.exe","C:\\coo7\\wizard.doc"};
    Process child = rt.exec(callAndArgs);
    Any idea/suggestions pls..

  • Run exe file with java script in Apex

    Hello All,
    I have a exe file which I need to perform in Apex. I created a function by java script as fallow:
    function RunEXE()
    var oShell = new ActiveXObject("WScript.Shell");
    var prog = "C:\WINDOWS\test.exe";
    oShell.Run('"'+prog+'"',1);
    Also, I created a button to run this function by redirect to URL as fallow:
    javascript:RunEXE();
    but it does not provide me any answer. Could any one help me on that please!!!!
    Thanks,
    Atousa

    No, they're it's no easy solution in java. However, it's not impossible to decompile an exe file, do there it's no real difference.
    Question is, who goes to the pain of compiling lots of jar files to get to your source code?
    Timo

  • Running exe files from java progam

    hi friends
    I just want to know how can i run a .bat or .exe file in windows from a java program...
    also i would like to know if i can check if mysql is installed in a windows computer from my java program
    Thanks
    Mustafa

    smshiraz wrote:
    thanks Jos
    now i am able to execute the .bat file.....from my java program
    Can you also please tell me how can i check from my java program how if a particular application is installed in my windows computer??The exec() call will more than likely fail if the application is not present; again, read the API documentation.
    kind regards,
    Jos

  • Running .EXE file from Java

    Do you know, how run an .exe file, for example Internet Explorer or other program, from Java application?
    It's very important for me.

    Too run external program and pass string arguments see class java doc
    of java.lang.Runtime method exec . You see online or download or
    rename src.jar to s.zip EXTRACT and see
    exec
    public Process exec(String[] cmdarray,
    String[] envp)
    throws IOException
    Executes the specified command and arguments in a separate process with the
    specified environment.
    This is a convenience method. An invocation of the form exec(cmdarray, envp)
    behaves in exactly the same way as the invocation exec(cmdarray, envp,
    null).
    Parameters:
    cmdarray - array containing the command to call and its arguments.
    envp - array of strings, each element of which has environment variable
    settings in the format name=value, or null if the subprocess should inherit
    the environment of the current process.
    Returns:
    A new Process object for managing the subprocess
    Throws:
    SecurityException - If a security manager exists and its checkExec method
    doesn't allow creation of the subprocess
    IOException - If an I/O error occurs
    NullPointerException - If cmdarray is null, or one of the elements of
    cmdarray is null, or one of the elements of envp is null
    IndexOutOfBoundsException - If cmdarray is an empty array (has length 0)
    See Also:
    ProcessBuilder
    getRuntime
    public static Runtime getRuntime()
    Returns the runtime object associated with the current Java application.
    Most of the methods of class Runtime are instance methods and must be
    invoked with respect to the current runtime object.
    Returns:
    the Runtime object associated with the current Java application.

  • Problem in Running EXE file from Java

    Hello Friends,
    I am calling an EXE program from my JSP page using Runtime.exec() method. The exe file simply reads a file and writes the content into another file (like copying a file). Now if I am providing fully qualified path to both source and destination files, then it runs absolutely fine. However, if i don't mention file path (only fine name is there), it creates output file in System32 folder and the resultant file doesn't contain any data.
    I am providing the source for the EXE file.
    ==============
    Source 1 (with fully qualified path name)
    #include <stdio.h>
    #include <fstream.h>
    #include <iostream.h>
    #include <string.h>
    #include <stdlib.h>
    void write_temp_file1(char *);
    void main()
    char * myTempPath=NULL;
    myTempPath=(char *)calloc(100,sizeof(char));
    strcpy(myTempPath,"D:\\temp\\tempFile.txt");
    write_temp_file1(myTempPath);
    myTempPath=NULL;
    void write_temp_file1(char * fileName)
    // first read the file and write another file with same content
    char * line1=NULL;
    char * line2=NULL;
    char * line3=NULL;
    line1=(char *)calloc(100,sizeof(char));
    line2=(char *)calloc(100,sizeof(char));
    line3=(char *)calloc(100,sizeof(char));
    ifstream inf;
    inf.open(fileName,ios::nocreate);
    inf>>line1;
    inf>>line2;
    inf>>line3;
    inf.close();
    ofstream outf;
    strcat(fileName, "1");
    outf.open(fileName);
    outf<<line1<<endl;
    outf<<line2<<endl;
    outf<<line3<<endl;
    outf.close ();
    ================================
    Scenario 2 (with file name only)
    #include <stdio.h>
    #include <fstream.h>
    #include <iostream.h>
    #include <string.h>
    #include <stdlib.h>
    void write_temp_file1(char *);
    void main()
    char * myTempPath=NULL;
    myTempPath=(char *)calloc(100,sizeof(char));
    strcpy(myTempPath,"my_temp_from_exe.txt");
    write_temp_file1(myTempPath);
    myTempPath=NULL;
    void write_temp_file1(char * fileName)
    // first read the file and write another file with same content
    char * line1=NULL;
    char * line2=NULL;
    char * line3=NULL;
    line1=(char *)calloc(100,sizeof(char));
    line2=(char *)calloc(100,sizeof(char));
    line3=(char *)calloc(100,sizeof(char));
    ifstream inf;
    inf.open(fileName,ios::nocreate);
    inf>>line1;
    inf>>line2;
    inf>>line3;
    inf.close();
    ofstream outf;
    strcat(fileName, "1");
    outf.open(fileName);
    outf<<line1<<endl;
    outf<<line2<<endl;
    outf<<line3<<endl;
    outf.close ();
    ==========================
    Can anyone figure out what could be the problem ? I think there is a problem with Library Path or sort of something like that.
    Please help me.
    -- Niranjan

    providing source code for the EXE program doesn't tell your problem.
    You have to be more specific. What is your problem?

  • How to run .exe files with Virtual PC for Mac

    Hey Guys, I'm new around here and with mac technology as well. Anyway, I have an iMac OS X 10.5.1 Leopard and I've recently purchased the Virtual PC for Mac 7.0.2 software. So I'd like to know how to use this program properly, because I need to run some executable files in my computer. It is confusing for me because I don't know how to get started, and I only get to the part when it says "OS not found, Install an OS on this hard drive".
    Honestly I've no idea of what an OS is or where do I get that. So I'd really appreciate if one of you guys could tell me, step by step, what to do to use Virtual PC properly, and finally learn how to run .exe files on mac.
    Thanks in advance!
    Have a nice day!

    Always nice to see new faces
    Honestly I've no idea of what an OS is or where do I get that.
    This brings up the second part of your problem. The first part is setting up either a proper Virtual Machine program like Parallels or VMfusion, or setting up a Boot Camp partition on your drive.
    http://www.parallels.com/
    http://www.vmware.com/products/fusion/
    OS stands for Operating System. You are running Leopard 10.5.7 as an operating system on your Mac (MacOS X).
    The second part of your problem - You will need a copy of Windows XP or Vista if you want to run Windows on your Mac.
    There is at least one other solution for running Windows programs on a Mac. It's called "CrossOver" by a company named 'Codeweavers'. It's based on a project for "Wine" to be able to run PC programs on a Mac or Linux, without having to buy or install Windows. It works with a narrow subset of Windows programs so you would want to make sure the program you want to run is compatible with CrossOver before you buy it.
    http://www.codeweavers.com/products/cxmac/
    In addition to all the above information, you need to upgrade your Mac to the latest 10.5.7 from 10.5.1. "Software Update" is located under the black Apple icon in the Menu Bar at the top left corner of your monitor. After you are updated you will want to update your Profile here so that it shows the proper OS version.
    With your level of experience with MacOS X and the Windows OS's you should probably get some help from a local Apple store. They have an appointment system and do offer many types of help and training, and they can offer assistance with choosing the proper programs for you to purchase for your machine.
    You are also welcome to continue to ask questions here, of course. You will want to ask your questions with different issues that come up in different threads so that the answers stay focused on the title of the thread.
    Message was edited by: dechamp to try to be more accurate with a fairly complicated issue...

  • How to run exe file in cfm

    Hi all,
    Can anybody give me proper way to run exe file in
    coldfusion. I have tried with cfexecute tag but it is not
    working...
    Thanks,
    Manoj

    tclaremont wrote:
    > Are you trying to run an executable on the server, or on
    the client machine?
    > Does the CF service have execute permissions on the
    directory in question? What
    > does your error log say with regard to the attempted
    execution?
    >
    To add to all these valuable questions, what executable are
    you trying
    to run, what kind of parameters does it need? It can be a bit
    tricky to
    pass complex parameters through the <cfexecute ...>
    tag.

  • How to run .exe files on macbook pro

    Just bought my first macbook pro the other day.  I absolutely love it.  Much better than the windows boxes.  I wanted to run some '.exe' files on my new laptop but was not successful finding anything on the market to use without purchasing a full OS version of Windows.  Is there any software out there that I can use to run '.exe' files without purchasing a full Windows OS to do so.  I know about parallels for MAC but that seems to require purchasing Windows OS?  Any help is greatly appreciately.
    Here are the specs on my Macbook Pro.
    2.2GHz quad core i7
    4GB RAM
    500GB HDD

    Some Windows software -- not all, by a long shot -- will run on a Mac without installing Windows, with the aid of the CrossOver Mac emulator:
    http://www.codeweavers.com/products/cxmac/
    Games generally won't. For those, you need Windows installed through Boot Camp so you can run Windows natively.

  • How to run .exe files in mac pro?

    how to run .exe files in mac pro?
    i am looking for this to play games in my mac pro.
    if someone got a answer, just let me know
    cheers.

    mailking wrote:
    And I fail to see why you are attacking me...
    My comment is Valid...  " .exe files will not run natively on Mac OS X..."
    I am sorry. I had the false impression that it was commonly known that .exe files did not run on Mac OSX natively and failed to see any constructive critique you were bringing. Maybe I am wrong. Again deepest apologies.
    Unfortunately... these days... not every one is aware of this .exe  fact..
    Apology accepted.. and Thank You..

  • Enable to  run .exe file which is created from .air file  in windows 7?

    Enable to  open .exe file which is created from .air file which is created from adt command in windows 7 .
    for run .exe file ::
    The user must right click and select "Run as Administrator" for run successfully.
    so How to remove this above permission issue in Windows 7?
    Thanks
    Sunil

    Right-click on the exe file and choose Properties.
    Switch to the compatibility tab and uncheck the box next to "Run this program as an administrator". Click "ok".

  • Running exe file

    Hello,
    Is there any way that i can run exe file from wd application ?
    I will appreciate any answer or hint.
    thanks in advance,
    Ofer.

    Hi Ofer ,
    i think , u have to manually run the application in the client side after downloading from the server itself..
    u have to kept it in server , and allow the client application to download it to client side and then execute..
    otherwise , u have to programaically  do these steps ,, copying the exe from server to a tem location in client and execute this in client side...
      we can access files which are residing in server in one mor way .. thats with WebDav ... u have to set up this in the Enterprise portal if u have ..
    if u have a  IIS server in the same server machine or another machine , u can put these there and using WebDav u can access...
    refer this for setting webdav in Windows..
    http://acs.ucsd.edu/info/webdav.php
                     Regards
                     Kishor Gopinathan

  • Problem running .exe files

    I cannot run .exe files on Windows 10. A pop-up window shows a message that the .exe file I am trying to run is missing. What can I do to solve this problem ?

    Keep in mind that the Win 10 build "refresh" operations are clearing parts of the registry back to default values, so some things you've installed might end up uninstalled or only half installed after an upgrade to a new TP build.
    What EXACTLY is going wrong?  In other words, exactly what are you trying to do, and what is the exact content of the message(s) you're seeing.
    Details matter.
    -Noel
    Detailed how-to in my eBooks:  
    Configure The Windows 7 "To Work" Options
    Configure The Windows 8 "To Work" Options

  • How to run .exe files with DAQ on a target PC?

    Hi,
    I want to run LabVIEW executable files on a target PC, where there is no LabVIEW installed. These files are used to do measurement using DAQ devices.
    In order to run these .exe file, I guess that I should install both LabVIEW Runtime Engine and NI-DAQmx on the target PC. Is it right?
    I'm wondering if it is mantatory to install NI-DAQmx on the target PC. I tried running .exe files without NI-DAQmx installed, but there was an error: nilvaiu.dll couldn't be found. Shouldn't this file be included automatically when building the executable files?
    Thanks,
    Qifu

    No, none of the hardware drivers are included in the LabVIEW exe that you build. You have to install DAQmx. With LabVIEW 8.x, you can include the DAQmx driver with the installer that you create. You also have the option to install different versions of DAQmx. These different versions are smaller than the full DAQmx install (i.e. you may choose to install documentation, MAX. etc.). When you create the installer, you also inclue the LabVIEW run-time and you should also choose to install the hardware configureation that is in MAX.

Maybe you are looking for