invoking other programs

I want to write a program that would invoke other commands on the system (ex: dir (dos) or ls(unix)). Can someone give me a hint on how to get this done? Thanks in advance.
ken2Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
nietodConnect With a Mentor Commented:
The only portable way is to use the system() function which is part of the C run-time library.  There are some non-portable ways that may provide you with more control/options however.

Let me know if you have questions.
0
 
jkrCommented:
Hi nietod - you're typing fast ;-)
Well, this usually can be done using the 'system()' command.
However, if you specialize on a certain platform (e.g. UN*X, NT, Win9x) there are eventually more sophistcated wayd to do this (NOTE: 'dir' in DOS is a built-in shell command, you'll have to use the command line 'command.com /k dir').
0
 
nietodCommented:
>> Hi nietod - you're typing fast ;-)
Quit complaining.  I was gone for 4 days, you had ample time to make it to the top.  : - )
0
 
jkrCommented:
nietod - did i complain <lol> ?
Not at all!!! ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.