Solved

Passing in Command line parameters

Posted on 2001-06-21
7
146 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now