Solved

Command Line Parameters in VB5

Posted on 1997-12-17
2
347 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

777 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