Solved

Passing in Command line parameters

Posted on 2001-06-21
7
145 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

17 Experts available now in Live!

Get 1:1 Help Now