How do you access external .exe within Java?

Say I wanted to feed a command to a .exe, right? How would go about doing that in Java and is there a cross-platform method or does it vary?

helplessguyhelp wrote:
tlgkumar,
Hi can you help me to solve a problem??Dude, just start a new thread with your question, and whoever sees it and finds it worth their time will answer.

Similar Messages

  • How do you access attachments embedded within survey results?

    How do you access attachments embedded within survey results?

    This is a tutorial explaining attachments:
    http://forums.adobe.com/docs/DOC-2656

  • How can I call external exe in java

    Hi ,
    Is It Possible to call external exe in java.
    I read Runtime.exe("some exe") but actually my exe expects some input to process for that how can i pass the input to my exe and how can get the response from exe to my java class.
    any sample code is welcome.
    Thanks
    Babu H

    example
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.io.*;
    public class RuntimeExample extends JFrame {
        private JTextArea textArea;
        private JTextField textField;
        private PrintWriter writer;
        public RuntimeExample()
            init();
            initProcess();
        public void init()
            textArea = new JTextArea(20, 80);
            textArea.setEditable(false);
            textField = new JTextField(30);
            textField.addKeyListener(new KeyAdapter()
                public void keyPressed(KeyEvent event) {
                    if (event.getKeyCode() == KeyEvent.VK_ENTER)
                        if (writer != null)
                            textArea.setText("");
                            writer.print(textField.getText() + "\r\n");
                            writer.flush();
                            textField.setText("");
            Container container = getContentPane();
            JScrollPane scrollPane = new JScrollPane();
            scrollPane.setViewportView(textArea);
            container.add(scrollPane, BorderLayout.CENTER);
            container.add(textField, BorderLayout.SOUTH);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            pack();
            textField.grabFocus();
            setVisible(true);
        public static void main(String[] args) {
            new RuntimeExample();
        public void initProcess()
            Runtime rt = Runtime.getRuntime();
            try
                //Process p = rt.exec(new String [] {"cmd", "/C", textField.getText()});
                //textArea.setText("");
                //textField.setText("");
                Process p = rt.exec("cmd");
                writer = new PrintWriter(p.getOutputStream());
                Thread thread1 = new Thread(new StreamReader(p.getErrorStream()));
                Thread thread2 = new Thread(new StreamReader(p.getInputStream()));
                thread1.start();
                thread2.start();
                System.out.println("Exit Value = " + p.waitFor());
            catch (Exception ex)
                textArea.append(ex.getMessage());
                ex.printStackTrace();
        public class StreamReader implements Runnable
            InputStream is;
            public StreamReader(InputStream is)
                this.is = is;
            public void run()
                try
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                    String data;
                    while ((data = reader.readLine()) != null)
                        textArea.append(data + "\n");
                    reader.close();
                catch (IOException ioEx)
                    ioEx.printStackTrace();
    }you can pass input to the exe by using getOutputStream() from Process and get the output from getInputStream() from Process

  • How do you access files from an external harddrive connected to TC through USB from iPad or windows computer?

    How do you access external hard drive data that is connected to TimeCapsule through USB from iPad or knows based computer?

    Filebrowser for the iPad does this very well.
    FileBrowser - Access files on remote computers for iPhone, iPod ...
    Cannot help on Windows, but another PC guy might be able to answer. Some possible clues here:
    http://support.apple.com/kb/HT1331

  • How can i access the stepname within a steps post-expression?

    How can i access the stepname within a steps post-expression?
    i only saw the step-id of the step: Step.TS.Id
    is there a pssibility to get the stepname from the id?
    thank you!

    Hi Fischer,
    use the expression NameOf(Step).
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How do I access external hard drive connected to AirPort Extreme via iPad

    Hello,
    How do I access external hard drive connected to AirPort Extreme via iPad / windows laptop.
    I donot have a Mac and I use windows laptop.

    For your iPad, you will need an app, like FileBrowser, to access the external drive.
    For your Windows laptop, you would access the drive like any other network share. The basic format is: \\<servername>\<sharename>, where, in this case, the servername is the base station name and the sharename is the name of the external drive.

  • How to run an external .exe file from an indesign pluging

    Hi,
          Suppose if I have written an separate application in C++ (.exe file) & need to run it from an indesign pluging(as if a service in windows). have you provided that facilities in your SDK? if it's please let me know how to run an external .exe file from a indesign pluging.
    Thanks,

    I'm actully writing data in PMString to a external txt file.
    another question..
    if i want to execute an action when the ok button is cliked how can i do it?
    whe i add a button(widget) i know how to handle it. please see my code.
    // Call the base class Update function so that default behavior will still occur (OK and Cancel buttons, etc.).
    CDialogObserver::Update(theChange, theSubject, protocol, changedBy);
    do
    InterfacePtr<IControlView> controlView(theSubject, UseDefaultIID());
    ASSERT(controlView);
    if(!controlView) {
    break;
    // Get the button ID from the view.
    WidgetID theSelectedWidget = controlView->GetWidgetID();
    if (theChange == kTrueStateMessage)
    //if (theSelectedWidget == kEXTCODGoButtonWidgetID
    switch(theSelectedWidget.Get())
             case kEXTCODGoButtonWidgetID:
      this->ViewOutput();
      break;
             case kEXTCODFindButtonWidgetID:
      this->SaveLog();
      break;
    // TODO: process this
    } while (kFalse);
    I do two actions "SaveLog" & "ViewOutput()" using two buttons. But i dont know how to execute an action when the ok button is clicked...

  • How Do To Represent A TimeTable Within Java?

    Hi,
    I know this question has been asked by many before but I did not find one that understood well.
    Basically I am wanting to find out how I would represent a timetable within Java, I was looking into it and was told hashmaps where a good idea. But the more research I have done into this area there very little help there is.
    Would any body like to point my on the right course of how to do this?
    Thank You
    Chris

    ChrisUK wrote:
    Thats what am trying to avoid, I don't what you guys to do that. Im looking for some guidance of what is the recommend tools/method's to use:
    e.g. ArrayList, Array, HashMap.. so on.This is really bringing out the analogies! That is like saying, "I want to build a shed. Should I pick up a hammer or a screwdriver first?"
    Design first, implement second.
    What is a timetable? What are its attributes? Does it have components? What can it do? What application tasks involve a timetable? What other objects does it communicate with?

  • How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed and you don't know what it is now?

    How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed by the former husband and you don't know what it is now?  And you set up your own new ID and account but can NOT access the updates, from the App store for the many apps that you already have, because they require that you sign in with that former now inaccessible ID and account and password?  Call it a problem of modern times and changing relationships, if you want to be charitable.

    So I guess it will only be new apps that I download that are allowed to give me their updates while 13 updates wait for me on an ID I can no longer access.
    Yes...  sorry.
    In the future, if need be, you can re download your purchases for free  >  Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Good rule of thumb is to back up your purchases regardless  >  Mac App Store: Backing up your app purchases

  • How do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the onli

    how do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the online photoshop, and I really want to create my own customized url and post photos to my gallery and share them with the world, family, and friends, but i need help because i can't figure how to do any of this, would really appreciate feedback and assistance, thanks, - claire conlon

    To add to sig's reply, "calibrating" does not calibrate Lithiu-Ion batteries, it calibrates the charge reporting circuitry.  If you look at the effect of deep discharging Lithium-Ion batteries in the data from the independent test group, Battery University, you will see that doing so shortens the life of the battery significantly. It looks like an optimum balance between use and life is at a discharge level of 50%.

  • Iphone ios5..I upgraded to ios5 on my iphone 4 and in the demo video on the Apple website it shows a cute animation screen with the user dragging what appears to be balloons on a string how do you access this screen?

    iphone ios5..I upgraded to ios5 on my iphone 4 and in the demo video on the Apple website it shows a cute animation screen with the user dragging what appears to be balloons on a string how do you access this screen?
    Not sure if this is a game or app or not...it shows nothing about it and explains nothing about it...but it is there on the demo video on the apple website for the add to upgrade to ios 5...it shows the user dragging threads and the little icon monster at the bottom of the screen catches them

    Yea thats a game called "Cut the Rope" and it can be found in the App Store for $0.99 or you can buy the Lite version for free.

  • HT4847 How do you access your pictures that you stored on icloud from your ipod touch? I lost my ipod touch and want to get my photos from icloud but i cant seem to find any ******* help. where the **** is icloud and how do you get your stored pictures ba

    How do you access your pictures that you stored on icloud from your ipod?

    sunshinecowgill wrote:
    We have three operational computers, one does not have iTunes on it.  Since Apple is saying I have more than 5 authorized computers, and I can't imagine what they are, I am afraid to deauthorize all my computers.  See what I mean?  I just wanted to ask the question about how I can find out WHICH computers Apple thinks I have authorized, so I can decide if it's safe to deauthorize them all or not. 
    You could have more 5 computers authorized if you ever, for example, reformatted a hard drive or replaced a hard drive without deauthorizing the computer first. Apple's system would see that as a different computer, even though you don't. There's nothing to be afraid of in deauthorizing everything and the reauthorizing what you actually have. You won't lose any data. Mistimp is correct, they can't tell you which computers are authorized.

  • How can you access the printer settings in CS5 when using Epson 4900?

    How can you access the printer settings when using Epson 4900 with CS5 12.1 x 64

    Open the print dialog box, click "print settings".

  • How do you access folders/files in other users Finder list?

    How do you access folders in other users finder list, once you have shared the folder or file

    You should be able to open and view the contents of any directories you have access permissions to using FInder, by navigating the directory tree to the folders in question and opening them as you would your own folders. If you know the full path-name of the directory, you can enter it into the Finder navigator opened by Apple-Shift-G; the dialog that pops up uses the same directory listing method as all unix systems, and has tab completion for ease of use. In general, all users have their home directories in /Users/, or you can simply use ~/../<name> to go to the home folder of a user via the parent (..) directory of your home (~) directory. If you are experiencing bugs or errors with this, as opposed to simply not knowing how to do this, please post any details of your experience so that others can help troubleshoot your problems.

  • How do you stop ElementsAutoAnalizer.exe

    How do you stop ElementsAutoAnalizer.exe to update in Photoshop Priemere Elements 11? I can not find this program running anywhere. It is not listed in my running programs. So what is it a ghost?

    Hi DOUGHJO,
    Please refer to this forum thread: http://forums.adobe.com/thread/501214
    Hope this helps
    ~deepak

Maybe you are looking for

  • Error when consuming Web Service in SAP R/3 ECC 6.0

    Hi to everyone. I have created an asynchronous Web Service in SAP R3, which I want to use in SAP PI later. When I test the Web Service using WS Navigator or XMLSpy the following error occurs: SOAP Runtime Protocol: ABAP Runtime exception: 1F09B73915F

  • Itunes 6 wont open

    Hello, ive been trying to open itunes for a while now and it wont open. I click on it and it looks like its gonna come up but nothing does. I fixed this problem before with MSCONFIG and it worked for a while but now i do it and nothing happens. Pleas

  • Receiver File Name with date

    Hi @, I have a requirement where I wanted to genereate the recevier file name as TestYYYYMMDD.txt format. Note that in Receiver target structure date is not coming and output file also we dont require date data. I tried to put the Date root node and

  • Bluetooth disconnecting on Samsung Stratosphere?

    Hello all! I have a Samsung Stratosphere, and I use a Plantronics Voyager Pro + Bluetooth headset with it.  I have been having trouble with the phone not connecting to the headset if it has been idle for a while, and I have even had the Bluetooth dis

  • How let labview to verify string is in Scientific Notation.

    Hey all, I want labview to convert a spreadsheet string to an array. This is easy using the 'spreadsheet string to array' tool. The only problem I've got is that I get the string from a RS232 device and it is time critical. Example: If I read the dat