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

Hep:how to pass parameter along exe through cmd prompt

Status
Not open for further replies.

bugeditor

Technical User
Oct 9, 2001
44
0
0
IN
Hi,
I developed a VB project, which doesn't consists of any forms..

it have just have code bas modules in whcih i will be doing some manipulation of files

In start up project Iam invoking through SUB MAIN.
and Generated an exe..Invoking from DOS prompt

My problem is:
Sub main doesn't takes any parameter..
So iam forced to put input box to pass paramater when invoking from command prompt..

Can anybody help me..How to pass parameter along exe through command prompt

..say like

C:\>myexe <parameter>

can I do that..

Any Idea

Thanks
 
Check out the [bb]Command[/bb] function in VB help. In summary, Command returns any arguments that appear after the name of the application on the command.
 
Thanks very much..
Is there anyway to pass result/success to console..instead of window..

regards
chakri
 
Don't be surprised,
actually i was trying for this and got it..but..I want even result to console..

Anyway thanks once again
 
VB programs get disassociated from the console that launches them, so you cannot interect with that console (you CAN create your own console that belongs to your app and dump output in that).

If you can live with a numeric result, you can terminate your program using the TerminateThread API call, which allows you to pass a return code that can be checked with ERRORLEVEL.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top