Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Parameters

Posted on 2002-06-22
1
Medium Priority
?
206 Views
Last Modified: 2010-05-02
Hi,
Please is there any one can tell me how can i define a command line parameters to an EXE and send a value to it from the command line ....

thanx alot
Loay
0
Comment
Question by:loay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
hongjun earned 200 total points
ID: 7101358
In your coding, add this.
Private Sub Form_Load()
   MsgBox Command
End Sub

You can of course use the Command variable anywhere in the program.


Run the exe like this assuming your exe is on the desktop
c:\windows\desktop\Project1.exe hello world

"hello world" will be echoed.


Below will show you roughly how to use the parameters.
Private Sub Form_Load()
   Dim aryParams()
   aryParams = Split(Command()," ")
   'will give
   'aryParams(0) = "hello"
   'aryParams(1) = "world"
End Sub

hongjun
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

722 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