Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,630 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,060 people online right now. Registration is fast and FREE... Join Now!




Implementing dos commands in C++

 
Reply to this topicStart new topic

Implementing dos commands in C++

empty.
post 1 Sep, 2007 - 07:31 AM
Post #1


New D.I.C Head

*
Joined: 14 Aug, 2007
Posts: 4


My Contributions


how i can implement dos commands like copy copy-con,type and others using command line arguments?? help please sad.gif
I m even unable to understand how to start codding

This post has been edited by empty.: 1 Sep, 2007 - 07:59 AM
User is offlineProfile CardPM

Go to the top of the page

Bench
post 1 Sep, 2007 - 08:32 AM
Post #2


D.I.C Addict

Group Icon
Joined: 20 Aug, 2007
Posts: 602



Thanked 10 times

Dream Kudos: 150

Expert In: C/C++

My Contributions


What exactly are you trying to implement? command-line arguments for your program?

Have a look here for a brief overview of command-line arguments.
http://www.cprogramming.com/tutorial/lesson14.html
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 1 Sep, 2007 - 11:44 PM
Post #3


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,905



Thanked 34 times

Dream Kudos: 2800

Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions


Use sprintf() to set all the parameters of the DOS Command in a string.
The final DOS Command can be given using the system() function.
User is offlineProfile CardPM

Go to the top of the page

empty.
post 2 Sep, 2007 - 01:14 AM
Post #4


New D.I.C Head

*
Joined: 14 Aug, 2007
Posts: 4


My Contributions


can u tell me whr i can find info abt those functions which u told and also suggest me hw i cn do tht project using command line arguments
smile.gif
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 2 Sep, 2007 - 02:16 AM
Post #5


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,933



Thanked 118 times

Dream Kudos: 8525

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


You can find all the information you need on those function here.
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 2 Sep, 2007 - 02:29 AM
Post #6


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,905



Thanked 34 times

Dream Kudos: 2800

Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions


Click here for information on sprintf.
Bench's Link on commandline arguments is good enough.

Suppose you are writing a function that creates a directory.
You can do something like this:
CODE
sprintf(final_cmd,"md %s",argv[1]);
system(final_cmd);

This is assuming that final_cmd is a character array and that the parameter for the md command is the first command line argument provided to the program.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 03:54AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month