Create a shellable program

  • Thread starter Thread starter peter
  • Start date Start date
P

peter

When you run a program like ip config from the command line you are
given the option to use switches like /all /renew ....

In vb.net how do you create a shellable application with switch options
like this?

Peter
 
From help file for Sub Main

Function Main(ByVal CmdArgs() As String) As Integer
Dim ArgNum As Integer ' Index of individual command-line argument.
If CmdArgs.Length > 0 Then ' See if there are any arguments.
For ArgNum = 0 To UBound(CmdArgs)
' Examine CmdArgs(ArgNum) for settings you need to handle.
Next ArgNum
End If
MsgBox("Hello World!") ' Display message on computer screen.
Return 0 ' Zero usually means successful completion.
End Function
 
dim x as string
x = Microsoft.VisualBasic.Command 'returns the portion of the command
line after the executable name.
 
When you run a program like ip config from the command line you are
given the option to use switches like /all /renew ....

In vb.net how do you create a shellable application with switch options
like this?

\\\
Public Module Program
Public Sub Main(ByVal Args() As String)
If Args.Length > 0 Then

' 'Args' is a string array that contains the command line
' parameters' values.
End If
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object.
 
Back
Top