Solved

Passing in Command line parameters

Posted on 2001-06-21
7
148 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 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

839 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