Results 1 to 5 of 5

Thread: run time switches

  1. #1

    Thread Starter
    Hyperactive Member beasty1711's Avatar
    Join Date
    Mar 2001
    Posts
    418

    run time switches

    is it possible to put a switch on the end of my exe at runtime?

    i.e. C:\myapp.exe -a

    to start it in admin mode and

    C:\myapp.exe for normal mode??

    if so, how in vb would i pick up the switch?

    if anyone has examples i would be grateful
    thanx
    "...They even have the internet on computers..." :- Homer Simpson

    "Second Place is First Looser" :- No Fear

  2. #2
    PWNettle
    Guest
    Any command line arguments passed to your VB app are available by examining Command$. If you have a bunch of them you have to parse them yourself. If you want to experiment with this in VB you can go to your 'Project Properties', 'Make' tab, and put something in the 'Command Line Arguments' box - then you can play with Command$ to see what's passed. This feature is for testing command line arguments and doesn't affect your compiled project.

    Paul

  3. #3
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Use the Command$ function in your startup routine to get any command switches that were passed to the program. Then act based on them.

  4. #4

    Thread Starter
    Hyperactive Member beasty1711's Avatar
    Join Date
    Mar 2001
    Posts
    418
    wonderful.
    thanx ppl
    "...They even have the internet on computers..." :- Homer Simpson

    "Second Place is First Looser" :- No Fear

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Its available as Command or Command$.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width