Solved

how to read Command Line Arguments from VB program

Posted on 2000-05-01
1
156 Views
Last Modified: 2010-05-02
How to read Command Line Arguments from VB program.

what are the commands in VB.

in C we reads the arguments like that


main(int argc, *argv[])

0
Comment
Question by:david2001
1 Comment
 

Accepted Solution

by:
khanate earned 50 total points
ID: 2765965
All "command line" input is stored in the command$ variable.  To work with it I usally but something in the form_load() sub, like

private sub form_load()
 if lcase($command) = "autostart" then
   call cmdStart_click
 endif
endsub

The nice thing about command$ is that it can be given either from the DOS box or from another program's shell() function.  Example:

private sub cmdStartOtherProgram_click()
 shell("c:\compiled_projects\other_project.exe autostart")
endsub
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel - Save a copy of work book 13 88
Access 2013 combo box not working 3 51
TT Auto Dashboard 13 95
Publisher:   Unknown     VB.exe Application 1 27
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question