Passing command-line options to VB programs.
Results 1 to 5 of 5

Thread: Passing command-line options to VB programs.

  1. #1
    Registered User
    Join Date
    Apr 2001
    Location
    Tiffin, Ohio
    Posts
    101

    Post Passing command-line options to VB programs.

    Hi, we are trying to write a Visual Basic program (version 6) and need some help with something that's probably really simple.

    How do you pass command-line options in Win 9x (i.e., a path and file name) to a visual basic program? I know I'll shoot myself when I hear the answer.

    Thanks.

  2. #2
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    yes you will! LOL


    x = command

    Parse x as you wish

  3. #3
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    Easy VB APP for ya.

    Create a text box!

    On form_load

    text1.text=command

    Thats all..you can see what passes through then.

  4. #4
    Registered User
    Join Date
    Apr 2001
    Location
    Tiffin, Ohio
    Posts
    101

    Post

    Thanks bunches for the quick and accurate reply!

    Bang!
    (That's the sound of the gun going off)

    hehehe

  5. #5
    Registered User
    Join Date
    Jan 1999
    Location
    London, Great Britain
    Posts
    300

    Thumbs up

    Tip: Use the Command internal variable in conjunction with the InStr function to see which parameters have been passed.

    For example, if you want to see if an auto-run switch, such as -run, has been passed, then you can do something like:

    Code:
    if InStr(LCase(Command), "-run") then
        Call RunMyFunction
    end if

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •