Sign in to follow this  
Followers 0
Vindicator209

Respond to CMD

3 posts in this topic

Hey, how would I go about making an executable that would do something when typed in through CMD? such as, if I opened commandprompt, typed in

myexe.exe

d <archive.zip>

I was thinking of making a special archive file type that could only be opened through an executable, but cant be done just by openeing an executable....

I was thinking, if I typed D <archive.zip> it would decompress the file into a folder, or if C <archive.zip> would compress it back into an archive.... =/ sorry if my question isint clear .....

Thanks

`MethodZero


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Are you talking about using command line parameters?

If so, you would do something like this

$Compress=False
if $CmdLine[0]>2 then
if $CmdLine[1]="C" then $Compress=True
$filename=$CmdLine[2]
endif

This is just an example, and can easily be adapted to accommodate additional command line parameters, or parameters passed in a different order (via a loop)

as a point of reference, $CmdLine[0] automatically returns the number of command line parameters passed.

Edited by improbability_paradox

Share this post


Link to post
Share on other sites

sorry for the 6 day late reply, thanks, it works great


[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0