FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Executing windows commands from a program

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
Logwad



Joined: 27 Dec 2004
Posts: 18

PostPosted: Sat May 28, 2005 10:01 am    Post subject: Executing windows commands from a program Reply with quote

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
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Sat May 28, 2005 4:48 pm    Post subject: Re: Executing windows commands from a program Reply with quote

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
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Sun May 29, 2005 12:10 pm    Post subject: Reply with quote

Import std.process and you have "all" you need.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Logwad



Joined: 27 Dec 2004
Posts: 18

PostPosted: Mon May 30, 2005 5:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group