Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Passing in Command line parameters

Posted on 2001-06-21
7
Medium Priority
?
157 Views
Last Modified: 2010-05-02
I have an exe that is being called from SQL Server using the scheduler.  I need to be able to pass parameters into the exe.  

Ex.
c:\Inventory.exe "c:\ftp", "test.txt", etc.

I can only call a exe and pass command line parameters.
0
Comment
Question by:CodeHead
7 Comments
 
LVL 18

Expert Comment

by:deighton
ID: 6214745
retrieve them in VB using the command$ variable
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 120 total points
ID: 6214746
the command object

Private Sub Form_Load()
    MsgBox Command
End Sub
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6214748
Same time :-)
0
Industry Leaders: 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!

 
LVL 2

Expert Comment

by:Microsoft
ID: 6214751
get rid of the quotes

you should be able to call c:\inventory c:\ftp\test.txt

or command /R C:\INVENTORY C:\FTP\TEST.TXT
cheers

Andy
0
 
LVL 1

Author Comment

by:CodeHead
ID: 6214801
deighton,
Could you give me an example of what you are talking about.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6214817
sample is in my comment :-/
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6214849
CJ_S is right, he gives an example of displaying the parameters, here is an example of how to do something with them:


Private Sub Form_Load()
  Dim aryParams()
  aryParams = Split(Command(),",")
  'will give
  'aryParams(0) = "c:\ftp"
  'aryParams(1) = "test.txt"
End Sub
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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 …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses

885 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