Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. .exe?... VB.NET

.exe?... VB.NET

Scheduled Pinned Locked Moved Visual Basic
tutorialcsharphelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aaron128
    wrote on last edited by
    #1

    Hello, I am new to writing console applications in VB.NET. I need some advice on how to get the little bit of text after the .exe /. For example if I open a command window and type program.exe /help or something like that Or if you type program.exe /? It will show help.... Thanks in advanced.:)

    Aaron

    C 1 Reply Last reply
    0
    • A Aaron128

      Hello, I am new to writing console applications in VB.NET. I need some advice on how to get the little bit of text after the .exe /. For example if I open a command window and type program.exe /help or something like that Or if you type program.exe /? It will show help.... Thanks in advanced.:)

      Aaron

      C Offline
      C Offline
      Coding C
      wrote on last edited by
      #2

      Hi, use command line arguments! command line arguments means the arguments you pass to your applications main() method. hope this works. Nitin...

      A 1 Reply Last reply
      0
      • C Coding C

        Hi, use command line arguments! command line arguments means the arguments you pass to your applications main() method. hope this works. Nitin...

        A Offline
        A Offline
        Aaron128
        wrote on last edited by
        #3

        Hmmmm, OK I know exactly what yo mean... But how? Thanks again

        Aaron

        D 1 Reply Last reply
        0
        • A Aaron128

          Hmmmm, OK I know exactly what yo mean... But how? Thanks again

          Aaron

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Your Sub Main can be changed to this:

          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
          Return 0 ' Zero usually means successful completion.
          End Function

          You can find more information here[^].

          Dave Kreskowiak Microsoft MVP - Visual Basic

          A 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Your Sub Main can be changed to this:

            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
            Return 0 ' Zero usually means successful completion.
            End Function

            You can find more information here[^].

            Dave Kreskowiak Microsoft MVP - Visual Basic

            A Offline
            A Offline
            Aaron128
            wrote on last edited by
            #5

            Thanks, I think I will get i working from here... Thanks again

            Aaron

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups