Urgent: call a Dos application


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Urgent: call a Dos application

Hybrid View

  1. #1
    Timouyas Abdessamad Guest

    Urgent: call a Dos application


    When I run myDosApp.exe from DOS, a screen appears and my app runs fine. However,
    when i use:

    Process p = Runtime.getRuntime().exec(c:/myDosApp.exe); p.waitFor();

    the app runs but I get no screen to appear thru my java app. I've heard of
    using START in front of myDosApp.exe to get a DOS window, but the START command
    throws off my p.waitfor(); and the waitfor() thinks it's done b4 myDosApp
    actually finishes.

    I need to know how to get myDosApp.exe to appear on the screen thru my java
    app without using the DOS start command. Thank you


  2. #2
    Paul Clapham Guest

    Re: Urgent: call a Dos application

    If your DOS program only produces console output and then terminates, you
    could redirect the output to a file (c:/myDosApp.exe >output.txt) and then
    show the contents of that file in a Java window. But if you want the DOS
    program's window to be inside a Java window, where you perhaps key input and
    it displays output, you can't do that in Java because it would be
    platform-specific. You'd need some kind of native method to handle this.

    Timouyas Abdessamad <timouyas@mailcity.com> wrote in message
    news:38eb6874@news.devx.com...
    >
    > When I run myDosApp.exe from DOS, a screen appears and my app runs fine.

    However,
    > when i use:
    >
    > Process p = Runtime.getRuntime().exec(c:/myDosApp.exe); p.waitFor();
    >
    > the app runs but I get no screen to appear thru my java app. I've heard of
    > using START in front of myDosApp.exe to get a DOS window, but the START

    command
    > throws off my p.waitfor(); and the waitfor() thinks it's done b4 myDosApp
    > actually finishes.
    >
    > I need to know how to get myDosApp.exe to appear on the screen thru my

    java
    > app without using the DOS start command. Thank you
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center