Jump to content
Sign in to follow this  
maqleod

Command Line Support?

Recommended Posts

maqleod

is there anyway to write a script that can accept commands from the command line?

There are a few programs I want to write that are too simple to need a gui, and it would just be nice to be able to call it in a cmd prompt with arguments to do what I want.


[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites
lordofthestrings

I did it like this:

Func getNamedArgument($NamedArgument)
    For $i = 1 to $CmdLine[0]
        If stringinstr($CmdLine[$i],$NamedArgument) Then 
            $TmpArray = StringSplit($CMDLINE[$i],':')
            Global $return = $TmpArray[2]
        EndIf
    Next
EndFunc

you can call this function easy:

getNamedArgument("/CommandLineSwitch:")

$CommandLineSwitch = $return


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  

×