How to run a vi from Java application?

I am passing data to a vi from my java swing application using data socket bean but I have to manually open and run the vi. How can I programatically open and run the vi from my java application without using ActiveX automation server?

I don't know Java but if you can issue a shell command then you can run the VI with the command line:
"\labview.exe" ""
You have to set the VI to "Run when opened". The VI will run each time the command is issued, even if the VI is already opened.
LabVIEW, C'est LabVIEW

Similar Messages

  • 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..

  • How to run ear file in java application server

    i want how to run .ear file in java application server
    1. i m created ear file
    2. i m created jar file (bean,home,remote)
    3.i m created war file(in the form of jsp)
    but till now i couldnt run ear file
    how to run
    please hel me

    You must create :
    1.Jar file
    2.War file
    And then put them into an ear file
    Exemple : myapp.ear contains
    myappEJB.jar
    myappWEB.war
    META-INF/application.xml
    and application.xml looks like this :
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee
                            http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>myapp</display-name>
        <description>Demo application</description>
        <module>
            <ejb>myappEJB.jar</ejb>
        </module>
        <module>
          <web>
             <web-uri>myappWAR.war</web-uri>
             <context-root>/myapp</context-root>
          </web>
        </module>
    </application>Good luck

  • Running a script from java application

    How do I execute a script (sms_setver which requires parameters such ms9qa) from java application using Runtime.exec(). I tried Runtime.getRuntime().exec("sms_setver ms9qa"). But, I get this error:
    Caught: java.io.IOException: CreateProcess: sms_setver ms9qa error=2

    Same way it is actually run from a console command line.
    If you are doing this in windows then it might be using the extension to determine how to run it. If from unix then it might be using the shebang line.
    At any rate figure it out and use that instead. Usually it involves either explicitly using the shell or some other executable and the script is a parameter to that process.

  • How to run ODI scenario from java?

    I am new to java, need to do some testing on how to invoke ODI scenarios from java.
    Can somebody drop me some simple code?
    Thanks a lot,
    Lei

    Hi there
    1. Start your agent (double click agent.bat)
    2. generate scenario for ur package(right click ur package , select generate scenario)
    3. Add the odi-sdk-invocation.jar file to your java project
    ODIcmdScenario=new OdiCommandScenario();
    ODIConnection=new OdiRepositoryConnection();
    ODIConnection.setOdiUser("ur-username");
    ODIConnection.setOdiPassword("ur-password");
    ODIConnection.setJdbcDriver("Driverdetail");
    ODIConnection.setJdbcUrl("url-details");
    ODIConnection.setJdbcUser("dbusername");
    ODIConnection.setJdbcPassword("dbpass");
    ODIcmdScenario.setScenName("scenarioname");
    ODIcmdScenario.setScenVersion("scenarioversion");
    ODIcmdScenario.setLogLevel(5);
    ODIcmdScenario.setContext("context");
    ODIConnection.setWorkRepositoryCode("repository");
    ODIInvocation = new OdiInvocation("hostname", 20910); //20910 default port
    OdiInvocationResult result=ODIInvocation.invokeCommand(ODIcmdScenario,ODIConnection);
    Hope this helps!
    Cheers

  • How to run SQL files from Java?

    Hi,
    Can someone point me towards a link on how to run sql files in Java? Thanks.
    P.S...if I've been completely blind please go easy on me!

    Sorry forgot the formating code thingy
    public static boolean executeScript(File script, Connection conn){
        boolean success = true;
        success = script.exists();
        if(success){
          DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
          StringBuffer buffer = new StringBuffer();
          success=readScript(script,buffer);
          if(success){
            try{
              String creationScript = buffer.toString();
              Statement st = conn.createStatement();
              int start = 0;
              int end = 0;
              while (end != -1 && start < creationScript.length()) {
                end = creationScript.indexOf("GO", start);
                if (end != -1) {
                  DEBUG.print(creationScript.substring(start, end));
                  st.executeUpdate(creationScript.substring(start, end));
                  start = end + 2; //2 is the length of "GO"
              st.close();
            }catch(Exception e){
              success=false;
              DEBUG.printStackTrace(e);
        }else{
          DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
          success=false;
        return success;
      public static boolean readScript(File script, StringBuffer buffer){
        boolean success = true;
        DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
        try{
          InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
          int ch;
          while ( (ch = isr.read()) > -1) {
            buffer.append( (char) ch);
          if (isr != null)
            isr.close();
        }catch(Exception e){
          success=false;
          DEBUG.printStackTrace(e);
        return success;
      }

  • How to Run a Hello World Java application on WIndows Mobile

    Hi!
    We have a sample Plug-in environment Java application downloaded from http://www-128.ibm.com/developerworks/library/os-ecl-ercp/index.html - IBM library.
    We have downloaded the source files org.eclipse.testworkbenchapp_1.0.0.jar and tried running the application on desktop PC, this worked fine.
    We are using Eclipse 3.2 to run this Java application on Desktop.
    Now, we are trying to run the same application on Intermec Windows Mobile 5.0 device.
    1. The device has IBM J9 ? WebSphere MicroEnvironment MIDP 2.0 for Windows Mobile2003 installed in it.
    2. On installing this on Windows Mobile, in Start ? Programs ? we find MIDlet HQ - on launching this, opens a window with Install button.
    3. On Click on Install button, another window opens which asks for URL to install.
    4. In the URL Edit box, I give file:////Org.Eclipse.testWorkbenchapp.feature_1.0.0.jar which is present in \MyDocuments\Update site folder copied from desktop workspace via Active sync ? As mentioned in the above IBM library site.
    5. I have also tried file:////MyDocuments\Updatesite\Org.Eclipse.testWorkbenchapp.feature_1.0.0.jar as input to URL.
    6. On click OK, I get an error titled AMS Error with description The application descriptor was missing the required MIDlet Name field.
    I am held up here and not able to move further.
    As mentioned in the above IBM library site I tried downloading the update site folder via Eclipse ? Software Updates ? Find and Install in Help menu.
    I selected Search for new features to install and browsed the Update site folder location present in my Eclipse workspace. This also does not work.
    Any help in this regard in greatly appreciated. Thanks in advance!

    I would ask such questions in the J2ME forums, or even better in a websphere forum, like here:
    http://www-128.ibm.com/developerworks/forums/wsdd_forums.jsp

  • How to run .html file from .java file..?

    Hi All,
    I was just trying as mentioned in the subject of how to run an html file from a java file.We have runtime class which inturn is having exec method which returns process but it supports only .exe as an argument .Is there any way to do this???
    Thanks in advance.

    viswa07 wrote:
    You mean to say Desktop class in java...???I'm so sorry, I thought you knew enough Java to look up the API.
    [This link|http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html] might be more at your level.
    db

  • Running .bat files from java applications

    Has anyone tried to run a .bat file from a java application?
    I know I can run java commands by getting the application's runtime, but I've a number of *.bat files I like to run from the application without having to extract the commands from the .bat files.
    thks,

    Crikey! You were answered very shortly after you posted your question, and you STILL haven't bothered to come back. And are you going to create a new userid the next time you ask a question, since bat2004 seems tied to this particular question?

  • How to run system commands from JAVA

    Hi Friends,
    How to run windows system commands from JAVA
    Runtime r=Runtime.getRuntime();
    r.exec("dir");
    Throwing following Exception
    CreateProcess :dir error=2
    Thanks in advance
    Hamsa

    Hi ,
    in Windows NT this is not possible, you can use the following :
    Runtime r=Runtime.getRuntime();
    StringBuffer sbuf = new StringBuffer();
    String dir = new String();
    java.lang.Process proc = r.exec("cmd /c dir");
    InputStream is = proc.getInputStream();
    int ch ;
    while((ch=is.read() ) != -1)
    sbuf.append((char)ch);
    is.close();
    dir = sbuf.toString();
    System.out.println(dir );

  • How to run perl file from java file..???

    Hi All,
    How to run a perl file from java file.I know that there is one JPL(Java-Perl Library) preprocessor which can be used to do this,but no idea of how to do it..
    Any help is appreciated.
    Thanks in advance.

    viswa07 wrote:
    Ok and any idea regarding JPL..????I don't know it and the first few posts that I found mentioned it using Java 1.1-style JNI calls, which hints at a dead project. And you don't want to use a dead project.

  • Cannot run batch program from Java Application

    Hi All,
    Im trying to run a batch file under windows from my Java Program. The batch file is located in the following path:
    C:\Program Files\MyApp\runme.bat
    The above-entioned path contains white space which is not allowed in NT.
    Im trying following code:
    import java.io.*;
    public class Exec {
    public static void main(String args) {
    try {
    Runtime.getRuntime().exec("cmd /c start C:/Program Files/MyApp/runme.bat");
    }catch(Exception ex){ ex.printStackTrace();}
    How to run this file?
    Thanks in advance.
    Ketan Malekar

    or use the overload that takes an array of strings as argument
    String[] command = {"cmd", "/c", "start", "C:/Program Files/MyApp/runme.bat");
    Runtime.getRuntime().exec(command);

  • Run windows services from java application

    can java application run a windows server
    i have a web server that runing using tomcat and mysql
    can i make a icon in the systray
    that give me the option to (using a menu)
    run the server ,wicth means : tomcat and mysql are runing
    stop the server
    get tomcat stacktrace in a window
    i was thinking about runing tomcat and mysql as services
    and write the systray application using java,
    the systray application should acces window services ,
    and run/stop requierd services.
    what happend on a machine thar runs linux?
    thanks
    shay

    Ok .so it's will be a diffrent way under linux..
    for systray i will use http://systray.sourceforge.net/
    and for services i'll use the
    "net start <Service>" and "net stop service"
    i need to keep track on the service status
    so my Systray status will be updated
    what is the command for getting the status of the proccess
    thanks shay

  • How to call other execs from java application

    What is the best way to make a call to execute an external executable written in another language (i.e. c++ or ada95) from within a java application?

    Hi,
    Runtime.getRuntime().exec(new String[]{"C:\\Office\\winword.exe"});
    you should catch IOException as well.
    Phil

  • How to run geniatagger.exe from java

    Hi,
    i'm trying to run geniatagger-1.0.exe from java on windows vista, using Process pr = Runtime.getRuntime().exec("C:/geniatagger-1.0/geniatagger-1.0.exe");
    However, i keep on getting the same error. "Cannot run *.exe CreateProcess error=2" . I tried the same code with excel.exe which is installed in C:/ProgramFiles
    and it worked. I also tried to create a path variable C:/geniatagger-1.0/geniatagger.exe;%path% and then run the same java code. Yet, nothing has changed.
    I would really apreciate any help

    dalab wrote:
    Sorry, i didn't realise that the link was already sent! I found that earlier as well. I"I..." what?
    "I ...figured it out"?
    "I ... still need help"?
    You're not a vampire named Trever are you?

Maybe you are looking for