Solved

Passing in Command line parameters

Posted on 2001-06-21
7
150 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
[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
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 30 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
Independent Software Vendors: 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

738 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