Making a Command Prompt command.

I know some basic stuff in C++ but what I don't get it is how to create a program for command prompt.

All I know is that main has to has these arguments:
 
int main(int argc,char* argv[]) {}

And I think I know what those arguments mean.
char* argv[] - for what arguments command has (e.x. -a -b...)
int argc - for the number of arguments
but...

I have discovered that in command prompt, commands don't have to have any queue on arguments
com -k-s == com -s-k, and they don't have to have anything infront of an argument
com -a == com /a == com a

How to create something like this?
Thank you.
Last edited on
what do you mean? a batch file?
Why did you copy my post? huh?
Last edited on
I think Framework dude is a roBot.
what do you mean? a batch file?

Yes.
*BUMP*
If your program is named com and you run it as
com -a == com /a == com a
then argc will be 8 and ...
1
2
3
4
5
6
7
8
argv[0] == "com"
argv[1] == "-a"
argv[2] == "=="
argv[3] == "com"
argv[4] == "/a"
argv[5] == "=="
argv[6] == "com"
argv[7] == "a"


You just have to check the arguments and do whatever it is you want to do.
Last edited on
Topic archived. No new replies allowed.