|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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)? 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 <za***@construction-imaging.com> wrote in message Show quoteHide quote news:1166478365.975415.281790@t46g2000cwa.googlegroups.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)? >
business layer, data access layer , presentation layer for asp.net using C#.net
Dynamically load a form Convert OEM to Unicode class types in vb.net Raising an event from a user control Inherited form Name from Base How to manage a exception in a Aplications Questions, questions...... Cleaning up Excel After using Excel Interop How do I find the computer name on which my program is running? |
|||||||||||||||||||||||