Running an application with command line parameters

Everything else that doesn't fall into one of the other PB categories.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Running an application with command line parameters

Post by SFSxOI »

How do you build in the ability to run a PB application with command line parameters?

i.e...

some.exe / do something / and do this

?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Any parameters passed to your application by the command line are accessible through ProgramParameter() etc. It doesn't need to be a console application for it to read these parameters.

Have I misunderstood?
I may look like a mule, but I'm not a complete ass.
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Post by Arctic Fox »

RunProgram(Filename$, Parameter$, WorkingDirectory$, Flags, SenderProgram) :?:
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

well, I created a small .exe that I want to be able to run with parameter switches to enable various options when it runs. So I need the .exe to be able to accept these parameters in the shortcut for it.

my_program.exe / parameter


@Artic Fox; yep I know about that one, but i'm not running another .exe.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

oh... and have a nice day.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

Thats it! Thanks Kaeru Gamin :)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

srod already mentioned it, maybe you just overlooked it...
oh... and have a nice day.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

yes i did, scrolled right past it, sorry srod, thank you also :)
Post Reply