• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

Passing in Command line parameters

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
CodeHead
Asked:
CodeHead
1 Solution
 
deightonprogCommented:
retrieve them in VB using the command$ variable
0
 
CJ_SCommented:
the command object

Private Sub Form_Load()
    MsgBox Command
End Sub
0
 
CJ_SCommented:
Same time :-)
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
MicrosoftCommented:
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
 
CodeHeadAuthor Commented:
deighton,
Could you give me an example of what you are talking about.
0
 
CJ_SCommented:
sample is in my comment :-/
0
 
TimCotteeHead of Software ServicesCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now