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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Passing command line arguments to vb.net

Passing command line arguments to vb.net

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
3 Posts 2 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.
  • V Offline
    V Offline
    vbTom
    wrote on last edited by
    #1

    I know this should be simple but I can't get it to work. Isn't there a way to pass command line arg's to a vb.net program without have to use the vb6 class? I search help but I must haver it installed incorrectly becuase it keeps saying it is updating my recent changes? Thanks Tom Tom

    D 1 Reply Last reply
    0
    • V vbTom

      I know this should be simple but I can't get it to work. Isn't there a way to pass command line arg's to a vb.net program without have to use the vb6 class? I search help but I must haver it installed incorrectly becuase it keeps saying it is updating my recent changes? Thanks Tom Tom

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

      Sure. You can use the System.Environment class to get the command line arguments in a String array. Something like this should work for you:

      Dim arguments As [String]() = System.Environment.GetCommandLineArgs()

      The System.Environment class will also let you get the entire command line as a String, get at environment variables, get and set the exit code of your app, current directory, NETBIOS machine name, ... Docs on the class can be found here[^] on MSDN. RageInTheMachine9532

      V 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Sure. You can use the System.Environment class to get the command line arguments in a String array. Something like this should work for you:

        Dim arguments As [String]() = System.Environment.GetCommandLineArgs()

        The System.Environment class will also let you get the entire command line as a String, get at environment variables, get and set the exit code of your app, current directory, NETBIOS machine name, ... Docs on the class can be found here[^] on MSDN. RageInTheMachine9532

        V Offline
        V Offline
        vbTom
        wrote on last edited by
        #3

        Thanks that worked Tom

        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