Thread: Initiating command prompt execution

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    50

    Initiating command prompt execution

    How would I initiate command prompt execution within a windows execution?

    For example, say I had a popup dialog in which I could paste a URL, and upon clicking "Ok" it would call a program that runs from the command line, and give it command line arguments?

    I ask this because I have a neat java program I made but at the moment, it will only run in the command line. I would like to give it a simple windows interface since windows supports easy cut and paste. (Yes, I know command line does too, but its irritating)


    Thanks!

  2. #2
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    I think the system command will do:
    Code:
    system("C:\\program.exe arg1 arg2");

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    You can launch a console prog from a windows environment and not display the console if you wish....

    You use CreateProcess the CREATE_NO_WINDOW option and pass handles that the console app uses for stdin & stdout...you then read to and from the app witout a console window....this will allow you to show the console's results while having a nice cut & paste gui....

    Have a search on the web for examples

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Execution Time - Rijandael encryption
    By gamer4life687 in forum C++ Programming
    Replies: 5
    Last Post: 09-20-2008, 09:25 PM
  2. Replies: 0
    Last Post: 10-06-2007, 01:25 PM
  3. Arbitrary Code Execution
    By CrazyNorman in forum C++ Programming
    Replies: 3
    Last Post: 04-10-2007, 02:33 PM
  4. What is the best way to record a process execution time?
    By hanash in forum Linux Programming
    Replies: 7
    Last Post: 03-15-2006, 07:17 AM
  5. Parallel execution
    By Panopticon in forum C++ Programming
    Replies: 2
    Last Post: 01-27-2003, 01:57 AM