SETP
asked on
Command Line Arguments
How can I read the command line arguments that a VB.NET 2003 program is launched with? For example, if I have a program call "SuperCalc.exe" and it is run as follows:
"SuperCalc.exe /r"
How can I detect from code that the command-line argument "/r" was used?
Thanks
"SuperCalc.exe /r"
How can I detect from code that the command-line argument "/r" was used?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! Didn;t know there was an Environment class. Nice...
Glad to help once again :-)
Dave
Dave
There's another way however which is this
Dim Str() As String = Environment.GetCommandLine
if Str(1) = "/r" then
'Do Something
End If
Here you need not Split as we get an array anyway