Solved

Command Line Parameters in VB5

Posted on 1997-12-17
2
346 Views
Last Modified: 2008-03-17
How can I process command line parameters in VB5?
0
Comment
Question by:lankford
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
dirtdart earned 50 total points
ID: 1445706
In your startup Subroutine (Sub Main or Form_Load) you need to process the built in variable Command or Command$ (either one does the same thing).  This will pass all the command line parameters entered when that program started into the program.
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1445707
Oops.  I guess I should tell you that it's just a string variable, so you can treat it like any other string variable.  For example, if you're expecting a Command line parameter of "jrf" then you can do this:

If Command = "jrf" Then
 'Do whatever....
End if


You can use multipule command line parameters by separating them with a comma (or whatever else you want, just as long as you remember what it is).  Just like this:

Dim x As Integer
Dim cmdOne As String
Dim cndTwo As String

x = InStr(Command, ",")
cmdOne = Left(Command, x - 1)
cmdTwo = Right(Command, x)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 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

15 Experts available now in Live!

Get 1:1 Help Now