How to call a dos variable in visual basic?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • David Goldstraw
    New Member
    • Jan 2011
    • 6

    How to call a dos variable in visual basic?

    I would like to know how to call a variable I have set in ms-dos using e.g. set h=hello in visual basic. Can this be done?
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    External parameters (like the %1 in DOSshell or BAT files) are enterd in VB by arguments.

    Command Line Arguments, if passed to an executable, are stored in a special System Variable,
    and can be returned to our program using the "Command" Function.

    The result is only seen by executing the program, not at program Run.

    The var "Command" is always present in VB (no need to define it)
    De var COMMAND is altijd aanwezig in een VB programma (het moet niet gedefineerd worden !)

    VB program=

    Private Sub Form_Load()
    Label1.Caption = Command
    End Sub

    Comment

    Working...