View previous topic :: View next topic |
Author |
Message |
Logwad
Joined: 27 Dec 2004 Posts: 18
|
Posted: Sat May 28, 2005 10:01 am Post subject: Executing windows commands from a program |
|
|
Hello, I am making a simple program that will use gui to create a little window that you can enter:
1) the path to the d compiler
2) path to someprogram.d
3) any arguments you wish such as "-L/exet:nt/su:windows:4.0"
and then click a button to have the program send commands with the said arguments to the command line.
So basically putting a gui in front of the command prompt, so I don't have to retype things all the time (yes I know about IDE's, but knowledge gained by solving this will help in other things as well). I do not know however, how to access the command line from a program. I am currently using windows, but am also starting to mess around in Linux (mandrake), so info on how to do this in linux would also be cool. _________________ BZFlag.
You know you want to. |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sat May 28, 2005 4:48 pm Post subject: Re: Executing windows commands from a program |
|
|
Logwad wrote: |
how to access the command line from a program. |
Code: |
int RetCode;
extern (C) int system (char *);
RetCode = system(std.string.toStringz(YourCommandLine));
|
_________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Sun May 29, 2005 12:10 pm Post subject: |
|
|
Import std.process and you have "all" you need. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
Logwad
Joined: 27 Dec 2004 Posts: 18
|
Posted: Mon May 30, 2005 5:40 pm Post subject: |
|
|
Quote: | Import std.process and you have "all" you need. |
Thanks, that is just what I needed, and more. :) _________________ BZFlag.
You know you want to. |
|
Back to top |
|
|
|