I need to know how to open a Visual Basic application and when opened run a function depending on the command line argument specified.<br>
<br>
Like this<br>
<br>
file.exe -on<br>
<br>
Any help appreciated<br>
<br>
Curtis
there is a word in VB called "Command"<br>
Any parameters apssed to your app with be in that Variable<br>
<br>
here is a very simplistic example<br>
Public Function GetComdLin()<br>
MyCommand = Command<br>
Debug.Print MyCommand<br>
If MyCommand = "-on" Then<br>
' do something<br>
GetComdLin = MyCommand<br>
End If<br>
<br>
End Function<br>
<br>
I would start with that and use "IF" statements to test for different "passed" values such as -on in your case<br>
<br>
you have the syntax correct for calling it i.e. file.exe -on<br>
<br>
Just put this in your Form Load event.<br>
<br>
Private Sub Form_Load()<br>
x = GetComdLin<br>
End Sub<br>
<br>
<br>
<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.