Execute another exe file by my VI

Hello,
I am trying to execute anothe exe file, which was not created using LabView, from my VI.
Is it possible? How could I do it?
Thank you

Use the System Exec function. Under Connectivity -> Libraries & Executables palette.

Similar Messages

  • Flash AS3, Need script for .exe to open another .exe file

    Hi all,
    Has anyone got a script to allow an .exe file to open another .exe file? If so, I could sure use the help.
    many thank in advance.
    HD superglide

    You can use fscommand("exec") to run a batch file to open an exe - but exe is a Windows executable, not for Mac OS
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • How to execute a .exe file in java(Jsp) without using a process ???

    Hi All ,
    How to execute a .exe file in Jsp without using a process ??? ...
    Is it Possiable ????

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • Through Java code I want to execute a exe file which is in aJar file

    I am having some classes and an exe file in a directory. I have made them in to a Jar file. In a class file which is in that jar file i want to execute a Exe file which is also resides in that jar file. Is it possible to exexute that EXE file?
    For Example....
    1. Im having a directory named CLIENT.
    2. In that directory I have 10 clss files and an EXE file.
    3. These class files and EXE files are ziped in to a Jar file.
    4. I have to give the Jar file to my client.
    5. He can put that Jar file where ever he installed my product may be C driver or D drive like that
    Now the problem is...
    I want to execute the Exe File from one of the class where both the exe file and class file resides in the Jar file
    This is my requirment
    Can anyone Help to me to solve this problem?
    Thanks in Advancd
    Ibram Shah.A.M
    ([email protected])

    The answer is to extract the EXE into a temp directory, execute it, and delete it when you're done. For example:
    //This is the path *inside* the JAR file!
    InputStream in = getClass().getResourceAsStream("/resources/myprog.exe");
    OutputStream out = new FileOutputStream("myprog.exe");
    File file = new File("myprog.exe");
    int data;
    while((data = in.read()) >= 0) out.write(data);
    in.close();
    out.close();
    //Execute the EXE here using java.lang.Runtime.exec()
    if(file.exists()) file.delete();
    ...

  • How to execute one .exe file with as3 in air ?

    Hi
    How to execute one .exe file with as3 in air?
    I want do this work without fscommand .
    plize help me .

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • How to execute a exe file using javascript on app window.load.

    How to execute a exe file using javascript on app window.load.

    Hi sb00349044,
    As I have already mentioned in multiple replies to your previous questions, the SUMO forums focuses on providing help to end users with usage-questions and issues.
    For developer-related questions, please refer to one of the many resources readily available that I have linked to in the past:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow]
    * [https://lists.mozilla.org/listinfo Mozilla Mailing Lists]
    - Ralph

  • Can AIR execute Windows .EXE files?

    Can AIR execute Windows .EXE files?

    hi
    you can now implement a standard windows installer (ie a native installer, rather than the AIR installer) when users install your AIR app. Not sure if there's an option to do this in flex/flash builder but it can be done via command line.
    eg:
    adt -package -storetype pkcs12 -keystore myCert.p12 -target native NativeProcessTest.exe NativeProcessTest-app.xml NativeProcessTest.swf NativeApps/Windows/bin/echoTestWindows icons
    or try this handy packager:
    http://www.webkitchen.be/package-assistant-pro/

  • Executing another exe from a java class

    Hi All,
    I want to execute another executable from a java class. I am doing that with the help of Runtime.getRuntime().exec(String) function.
    My executable runs for quite sometime and it keeps printing something to stdout consistently.
    I want to read whatever this exe is putting out to stdout as and when it is put out, not after the whole process has finished.
    Now, Runtime.getRuntime().exec(String) just spawns the exe in another process space and I am not able to get its handle, maybe I have missed something.
    Is there any other method/way to do what I want to?
    TIA
    -Satish

    Now, Runtime.getRuntime().exec(String) just spawns the
    exe in another process space and I am not able to get
    its handle, maybe I have missed something.
    Is there any other method/way to do what I want to?Acutally, Runtime.getRuntime().exec(String) returns a Process object. Use this process to "talk" to the program you just launched. For your needs, try Process.getOutputStream(). Take a look at the API for Process at http://java.sun.com/j2se/1.3/docs/api/java/lang/Process.html
    Hope this helps.

  • How to execute a EXE file in java?

    Hi!All
    as title
    Can I use Java to call any EXE file.
    I need your help!!

    ~~~Use This~~~~
    try{
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(
    "C:/Program
    Program Files/InternetExplorer/IEXPLORE.EXE
    http://192.168.1.101/index.jsp");
    why has private IP there?
    } catch (IOException e) {
    e.printStackTrace();
    }I and he want to a file which could run as .exe file.

  • How do I call another exe file from a Java program?

    Hi,
    I am doing a simple IDE (text editor/interpreter) for a simple programming language we are developing. It will be submitted as our project for this semester. I created an exe file (in C) which will be used as the interpreter. How do I call the interpreter from my IDE? The interpreter should run when the user clicks a button (i.e. the "Run" button). I've tried the Java Runtime class but it doesn't work. Anyone who knows how to do it?
    Thanks!

    I first tried to do a simple program that calls system commands such as dir, cd <dir>, etc.
    I do not have the exact code right now but as far as I can remember, here's what I wrote:
    class Sample{
        public static void main(String args[]) throws IOException{
           BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
           String command;
           while ((command = in.readLine()).equalsIgnoreCase("exit") == false){
              try{
                Runtime.getRuntime().exec(command);
              }catch(Exception e){
                 System.err.println("Error: " + e);
          System.exit(0);
    }

  • Psexec shows Access denied when i execute a .exe file on a remote machine

    Hi All,
    I am using Psexec application to run exe on multiple remote machines in the domain. When i run the the .EXE i get the error message saying access is denied.
    I am running this script against agents in a list.
    Below is the script i am running in the batch:
    "C:\Windows\system32\PsExec.exe" @C:\Test.txt cmd
    1. I am first connecting to the cmd of the remote computer and it connects successfully.
    2. When i enter the .exe file location on the command prompt (which is also in a shared drive but in the same domain).
    3. I ran the batch file as Run as administrator
    4. I am itself a member of the Domain admins and Administrators group of the domain.
    5. Turned off firewall on both sides.
    6. Turned off UAC fully as per the below MS article - http://technet.microsoft.com/en-us/library/cc709691(v=ws.10).aspx
    7. Pressed shift and right click so i will get the Run as option and mentioned different domain admins user account and password.
    Below is the screenshot for your reference: 
    Restated both the machines after doing these changes. But still the same issue.
    But still i get access is denied. Can anyone please help.
    Gautam.75801

    Few days back when i used to run the same task in this Access is denied mode its self. My destination server used to give a Audit failure event log as below.
    Now a days this event log does not come.
    Can this help for analysis.
    Subject:
    Security ID:
     Domain name\My username
    Account Name:
     Gautamr
    Account Domain:
    My Domain
    Logon ID:
     0x234992
    Object:
    Object Server:
    Security
    Object Type:
     File
    Object Name:
     C:\Windows\System32\eventvwr.msc
    Handle ID:
     0x0
    Process Information:
    Process ID:
     0x17e0
    Process Name:
     C:\Windows\System32\mmc.exe
    Access Request Information:
    Transaction ID:
    {00000000-0000-0000-0000-000000000000}
    Accesses:
     READ_CONTROL
    SYNCHRONIZE
    WriteData (or AddFile)
    AppendData (or AddSubdirectory or CreatePipeInstance)
    WriteEA
    ReadAttributes
    WriteAttributes
    Access Reasons:
    READ_CONTROL:
    Granted by
    D:(A;;0x1200a9;;;BA)
    SYNCHRONIZE:
     Granted by
    D:(A;;0x1200a9;;;BA)
    WriteData (or AddFile):
    Not granted
    AppendData (or AddSubdirectory or CreatePipeInstance):
    Not granted
    WriteEA:
     Not granted
    ReadAttributes:
    Granted by ACE on parent folder
    D:(A;;0x1301bf;;;BA)
    WriteAttributes:
    Not granted
    Access Mask:
     0x120196
    Privileges Used for Access Check:
    Restricted SID Count:
    0
    Gautam.75801

  • Which is the function to execute an .exe file in java

    in languages like c we can create .exe's of files.but in java we cant do that.
    i wanted to implement a software which i compiled in c using java.in c
    i created an .exe of the file and distributed it but in java i dont find any such
    method of creating exe as i would like to distribute the software.please help
    me out on this
    please also give me the name of the function using which i can exexute an
    .exe file

    No problem - it's just that I wanted to alert people to the fact that
    there was another thread. Otherwise It can get very confusing, very
    fast. (The CAPS were unnecessary, sorry about that.)
    Welcome to the forums!

  • Execute a .exe file I created?

    I've written a c++ file and compiled it; I now have an executable. I decided it'd be nice to have a pretty interface, and I thought it'd be easy to throw one together in java, and just call the executable from my java program. However, I've run into some trouble trying to use the Runtime.exec() command.
    I gather that the exec() command is good for shell commands, and evidently doesn't work for programs like mine. I was hoping to find a call similar to system(...) in c++, where it would execute the passed parameter as if it were on the command line (I know that's not what Runtime.exec() does). Could anybody tell me how to run an executable I've written from within java? Thanks.
    (this is what I wrote:)cmd[0] = "cmd.exe";
    cmd[1] = "/C" ;
    cmd[2] = "VBDoc";
    Process proc = runtime.exec(cmd);where "VBDoc" is the program I've written already, and I capture the output of the call.
    I get:
    ERROR>'VBDoc' is not recognized as an internal or external command,
    ERROR>operable program or batch file

    Several things:
    (1)I've included the file extension, and now it hangs - which is odd, because I included a "streamGobbler" thread as was encouraged in that write up to "promptly ... read the output stream of the subprocess". At least it's a different problem now. =)
    (2)Mark, you indicated in your first post that the entire path needed to be explicitly included, which I'm not convinced of: as I mentioned earlier, I included the executable's directory in the system path variable, so it can be executed from anywhere
    (3)Before I noticed all the latest replies to this question, I got Visual Studio installed on my computer and whipped together a VB GUI that solves my problem. <=\
    I'm still interested as to how I can execute the file, though. If any one is still interested, here's the code:import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.filechooser.*;
    public class htmlGUI extends JFrame
        static private final String newline = "\n";
        static Runtime runtime;
        public htmlGUI()
            super("htmlGUI");
            //Create the log first, because the action listeners
            //need to refer to it.
            //Actually, I don't really use this for anything important;
            //I used a java demo for my framework, cause I wasn't sure
            //how to open files from a dialog-style box.
            final JTextArea log = new JTextArea(5,20);
            log.setMargin(new Insets(5,5,5,5));
            log.setEditable(false);
            JScrollPane logScrollPane = new JScrollPane(log);
            //Create a file chooser
            final JFileChooser fc = new JFileChooser();
            //Create the open button
            ImageIcon openIcon = new ImageIcon("images/open.gif");
            JButton openButton = new JButton("Convert a File...", openIcon);
            openButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    int returnVal = fc.showOpenDialog(htmlGUI.this);
                    if (returnVal == JFileChooser.APPROVE_OPTION) {
                        File file = fc.getSelectedFile();
                        String fileName = file.getName();
                        //slap a comment in the textarea
                        log.append("Opening: " + file.getName() + "." + newline);
                        runtime=Runtime.getRuntime();
                        try
                                  String osName = System.getProperty("os.name" );
                                  String[] cmd = new String[3];
                                  if( osName.equals( "Windows 2000" ) || osName.equals( "Windows NT" ) )
                                       cmd[0] = "cmd.exe";
                                       cmd[1] = "/C" ;
                                       cmd[2] = "VBDoc.exe";
                                  else if( osName.equals( "Windows 95" ) || osName.equals( "Windows 98" ) )
                                       cmd[0] = "command.com" ;
                                       cmd[1] = "/C" ;
                                       cmd[2] = "VBDoc.exe";
                               else
                                    System.out.println(osName);
                             Process proc = runtime.exec(cmd);
                                  // any error message?
                                  StreamGobbler errorGobbler = new
                                       StreamGobbler(proc.getErrorStream(), "ERROR");
                                  // any output?
                                  StreamGobbler outputGobbler = new
                                       StreamGobbler(proc.getInputStream(), "OUTPUT");
                                  // kick them off
                                  errorGobbler.start();
                                  outputGobbler.start();
                                  // any error???
                                  int exitVal = proc.waitFor();
                                  System.out.println("ExitValue: " + exitVal);
                             catch(IOException ioe)
                                  System.out.println(fileName);
                             //     System.err.println(ioe);
                                  ioe.printStackTrace();
                             catch (Throwable t)
                                  t.printStackTrace();
                    } else {
                        log.append("Open command cancelled by user." + newline);
            //Create the save button
            ImageIcon saveIcon = new ImageIcon("images/save.gif");
            JButton saveButton = new JButton("Save a File...", saveIcon);
            saveButton.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    int returnVal = fc.showSaveDialog(htmlGUI.this);
                    if (returnVal == JFileChooser.APPROVE_OPTION)
                        File file = fc.getSelectedFile();
                        //this is where a real application would save the file.
                        log.append("Saving: " + file.getName() + ". (Yeah, Right)" + newline);
                    else
                        log.append("Save command cancelled by user." + newline);
            //For layout purposes, put the buttons in a separate panel
            JPanel buttonPanel = new JPanel();
            buttonPanel.add(openButton);
            buttonPanel.add(saveButton);
            //Explicitly set the focus sequence.
            openButton.setNextFocusableComponent(saveButton);
            saveButton.setNextFocusableComponent(openButton);
            //Add the buttons and the log to the frame
            Container contentPane = getContentPane();
            contentPane.add(buttonPanel, BorderLayout.NORTH);
            contentPane.add(logScrollPane, BorderLayout.CENTER);
        public static void main(String[] args)
            JFrame frame = new htmlGUI();
            frame.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            frame.pack();
            frame.setVisible(true);
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        StreamGobbler(InputStream is, String type)
            this.is = is;
            this.type = type;
        public void run()
            try
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    System.out.println(type + ">" + line);
                catch (IOException ioe)
                       ioe.printStackTrace();
    }Thanks!

  • Executing a .exe file brings up the DOS console

    Hello,
    My Java app calls a native program to run. I made an executable JAR file so users can just double-click on it to start the app. It all looks very nice except that, when my app calls the
    native program, a DOS console pops up on the screen. It closes itself when the process is
    finished but I'm wondering if there's a way to suppress the DOS console from popping up so
    that DOS consoles won't keep flashing on the screen while the app is running.
    The code I use to call the native program is as follows:
    Runtime rt = Runtime.getRuntime();
    Process child = rt.exec("someProg.exe");
    Thanks in advance for any help.

    First of all, thank you very much for your reply. I have checked the command associated with JAR files in my Windows system, it is already running it with javaw but random DOS consoles still flash all over the screen... Any other ways to work around this problem? Thanks.

  • Reg : Executing .exe file from application server

    Dear Experts,
                        i have a requirement to execute an .exe file from application server,i tried with method CL_GUI_FRONTEND_SERVICES=>EXECUTE but it executes .exe file from presentation server only.can
    anyone kindly clarify to execute .exe file from application server?
    Thanks in advance,
    Sujay

    Hi,
    Did you search before posting?
    Re: Execute a .exe file present in the Application Server
    Vikranth

Maybe you are looking for