Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting my app with command line arguments 1

Status
Not open for further replies.

Eldaria

Programmer
Sep 20, 2001
123
NL
Is it possible to use command line arguments for an application that I design?

The reason for this is that I want to make a program that I can start with command line switches.

So for example:
Myapp.exe Would start the application in hidden mode.
Myapp.exe /c Would start the app in Config mode.

You get the idea...

the reason for this is that I need to make a program that is going to be started by the Windows sheduler do what it is supposed to do and then shut down, and by default it will use a previuos saved configuration.
But I should have the possibility to start the app in configuration mode. Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
You certainly can. When you are calling the program, add all of the appropropriate switches to the command line before executing the Shell or eqivalent function.

CmdLine = "Myapp.exe /c"
Shell CmdLine

From within MyApp, to extract the values of the command line switches, take at look at the Command$ function. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Yup that worked...
Thank you...

Regards.
Brian.
Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top