For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > September 2004 > Verify path\filename of a shortcut









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Verify path\filename of a shortcut
Bill Baker

2004-09-29, 3:55 pm

I was initially going to post this as a question, but I discovered an answer
in the meantime:

How to verify the path\filename of a shortcut (without launching the
shortcut):

We have an app that launches on startup using a shortcut in the Start
Menu\Startup folder. During our maintenance activities, we don't want this
app to launch on windows startup, and the system is not always attended to
(since we're usually working on multiple systems). We've found that renaming
the target file (from .exe to .ex) is the easiest method for preventing the
app from launching.

This works fine, except that someone added a seemingly advantageous (yet in
reality, a very stupid) feature to Windows XP. This "feature" actually allows
the shortcut to "take a guess" at which target file it should use if it's
original target file is no longer available. I don't know what the criteria
is for this "feature", but after serveral reboots, the shortcut decides to
use a different file (in the same folder).

In any case, we have a VB app that we run to verify settings, and I needed a
way to make sure that the shortcut hasn't been "featurized". The solution is
simple: Open the shortcut as a text file. The path is readable among the
garbage.

Maybe this will help someone. In the meantime, I would like to hear of any
comments about this XP shortcut "feature".

--
Bill Baker
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com