Solved

how to read Command Line Arguments from VB program

Posted on 2000-05-01
1
150 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now