Start Menu or Autorun.INF?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zacks@construction-imaging.com

    #1

    Start Menu or Autorun.INF?

    Is there any way in VB code to tell if an application was invoked from
    an Autorun.INF file on a CD/DVD or if it was invoked from the Start
    Menu (or a shortcut)?

  • Newbie Coder

    #2
    Re: Start Menu or Autorun.INF?

    If the autorun starts setup then the location is usually held in the
    registry, but if you are just launching an exe then they will all do the
    same thing

    I suppose you can add command line attributes that would then pass the
    relavant parameter to the application & handle it that way

    Example:

    MyApp.exe "lnk"
    MyApp.exe "ar"
    MyApp.exe "cmd"

    In sub main you can the say:

    if args(0) = "cmd" then
    messagebox.show ("Command Line")
    else if args(0) = "ar" then
    messagebox.show ("Autorun")
    elseif args(0) = "lnk" then
    messagebox.show ("Shortcut")
    else
    messagebox.show ("Unknown Start Procedure")
    end if

    I cannot see another way to handle it apart from the above unless you know
    an autorun will be from CD/DVD you can trap that by checking the path, but
    for me the simple if statement running from sub main is the best idea,
    making sub main the application start point

    I hope this helps,

    Newbie Coder

    <zacks@construc tion-imaging.comwrot e in message
    news:1166478365 .975415.281790@ t46g2000cwa.goo glegroups.com.. .
    Is there any way in VB code to tell if an application was invoked from
    an Autorun.INF file on a CD/DVD or if it was invoked from the Start
    Menu (or a shortcut)?
    >

    Comment

    Working...