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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

App to run options at command prompt

Status
Not open for further replies.

mark01

Technical User
Jan 17, 2001
600
US
Is there anyway that I can format my app to run an option at a command prompt?

I'd like to have my app popup a message box based on what is entered at command prompt.

For example, suppose my app is called Msg.exe, and I enter this at command promt...

Msg Test

I'd like this to run code that call's MsgBox, and then for the text, enter in Test...

Thanks
 
Here you go
Thread222-297939 look at this


%, 2004
 
the above is used to write test to the command prompt and you can use that with the command$ variable

say you run your app msg.exe test

then you could have this

Sub Main()

if command$=lcase$("test") then
'Your code here
endif

End Sub

%, 2004
 
Actually, your program, as you described, would be as simple as this. Not sure where the console thread came into this but...

Code:
Sub Main
    MsgBox Command
End Sub

then you would execute your program from the command line as such (assuming your in the correct directory):

Project1.exe Test

This will give you a message box with the word Teston it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top