.lnk file questions

G

Guest

I have a question about shortcut (.lnk) files.

When I look at the properties of most of my .lnk files (the shortcut tab) I
see an executable file specification in the "Target:" field and its folder
specification in the "Start in:" field.

For some of the .lnk files the "Start in:" field is correct, but the
"Target:" field contains the name of the subfolder which contains the
shortcut.

I was wondering how Windows knows what executable file to execute?

Also, how was this shortcut created during installation?

I am running Windows XP Pro.
 
P

Pegasus \(MVP\)

Bractals said:
I have a question about shortcut (.lnk) files.

When I look at the properties of most of my .lnk files (the shortcut tab) I
see an executable file specification in the "Target:" field and its folder
specification in the "Start in:" field.

For some of the .lnk files the "Start in:" field is correct, but the
"Target:" field contains the name of the subfolder which contains the
shortcut.

I was wondering how Windows knows what executable file to execute?

Also, how was this shortcut created during installation?

I am running Windows XP Pro.

The "Start in" field directs Windows to make this folder the current
folder when starting the application. This allows the application to
locate some of its files. I suspect that if the Target field is not fully
qualified then Windows will "prepend" the "Start in" folder to the
"Target" name. You could easily verify this yourself by running a
few quick experiments.
 
G

Guest

The only problem is that the name in the "Target:" field is not the name of
the executable in the "Start in:" field.
 
P

Pegasus \(MVP\)

The "Start in" field is not supposed to contain the name of an
executable as you suggest, only the name of a folder.
 
G

Guest

That's right. But, the "Target:" field does not contain the name of any
executable file in the folder specified by the "Start in" field. Therefore,
how does Windows know which executable to execute? It does, but from the
information in the .lnk file - HOW?
 
P

Pegasus \(MVP\)

If you post the exact content of the two fields then maybe
someone can answer your question.
 
G

Guest

I thought about this after my last post.

Target: Karen's Power Tools

Start in: "C:\Program Files\KarenWare CD\Alarm\"

where C:\Program Files\KarenWare CD\Alarm\ptalarm.exe is the executable.

Also, the target field is grayed out so that it cannot be changed.
 
P

Pegasus \(MVP\)

I don't know why your target field is greyed out - maybe
a permission issue. If it bothers you - why don't you simply
create a new shortcut that is to your liking?
 
G

Guest

I opened the .lnk file in my editor and saw the name of the executable file
embedded in it. Do you know if Microsoft has a specification for shortcut
files on the web? I can create a shortcut file that would do the same as this
file, but it would be nice to know how this shortcut file was created.
 
E

... et al.

Bractals said:
I thought about this after my last post.

Target: Karen's Power Tools

Start in: "C:\Program Files\KarenWare CD\Alarm\"

where C:\Program Files\KarenWare CD\Alarm\ptalarm.exe is the executable.

Also, the target field is grayed out so that it cannot be changed.

I've seen these type of shortcuts with the target field grayed out. I've
wondered about them and also seen posts about them from others.

The answers i've seen have been that /they/ , these shortcuts, were
intended to be that way. ... ?!
Once someone answered that these shortcuts were 'Windows
Installer'-generated shortcuts. I haven't verified if this is true, but
it of course doesn't help explain why they differ, or why the Windows
Explorer GUI doesn't let us view the target to be executed.
 
C

cquirke (MVP Windows shell/user)

On Fri, 29 Apr 2005 18:31:05 -0700, "Bractals"
I thought about this after my last post.

Target: Karen's Power Tools

Start in: "C:\Program Files\KarenWare CD\Alarm\"

where C:\Program Files\KarenWare CD\Alarm\ptalarm.exe is the executable.

Also, the target field is grayed out so that it cannot be changed.

Sounds similar to MS Office's "special" shortcuts. I presume the
executable name and path is resolved through some CLSID trickery
and/or the AppPaths section of the registry.


---------- ----- ---- --- -- - - - -
Gone to bloggery: http://cquirke.blogspot.com
 
T

Torgeir Bakken \(MVP\)

.... et al. said:
I've seen these type of shortcuts with the target field grayed out. I've
wondered about them and also seen posts about them from others.

The answers i've seen have been that /they/ , these shortcuts, were
intended to be that way. ... ?!
Once someone answered that these shortcuts were 'Windows
Installer'-generated shortcuts. I haven't verified if this is true, but
it of course doesn't help explain why they differ, or why the Windows
Explorer GUI doesn't let us view the target to be executed.
Hi

For a shortcut that is created by Windows Installer, the target field
is not possible to edit, because the shortcut doesn't start an exe file
directly (hence the grayed out target field).

More here:

INFO: How Windows Installer Shortcuts Work
http://support.microsoft.com/default.aspx?scid=KB;en-us;243630


The "Requesting a Feature" link in the article above is outdated,
here is the current one:
http://msdn.microsoft.com/library/e...installation_of_features_components_files.asp
 
E

... et al.

Torgeir said:
Hi

For a shortcut that is created by Windows Installer, the target field
is not possible to edit, because the shortcut doesn't start an exe file
directly (hence the grayed out target field).

More here:

INFO: How Windows Installer Shortcuts Work
http://support.microsoft.com/default.aspx?scid=KB;en-us;243630


The "Requesting a Feature" link in the article above is outdated,
here is the current one:
http://msdn.microsoft.com/library/e...installation_of_features_components_files.asp

Thank you.
 
K

Keith Miller

More info here:

http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf

Shortcut files contain additional info not revealed by their property sheets.

A quick demo of this is to create 3 different shortcuts to my documents by right-click + drag. One for the Desktop My Docs, on for My Computer -> <UserName> Documents, and one for c:\docs & settings\username\My Docs. The target field properties will be identical, but if you open them & view the folder pane, you will see they each occupy a different place in the namespace.

Keith
 
K

Kelly

Great to see you here again, Keith!
BTW, you are one (of three) of my favorites. :blush:)

--

All the Best,
Kelly (MS-MVP)

Troubleshooting Windows XP
http://www.kellys-korner-xp.com


More info here:

http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf

Shortcut files contain additional info not revealed by their property
sheets.

A quick demo of this is to create 3 different shortcuts to my documents by
right-click + drag. One for the Desktop My Docs, on for My Computer ->
<UserName> Documents, and one for c:\docs & settings\username\My Docs. The
target field properties will be identical, but if you open them & view the
folder pane, you will see they each occupy a different place in the
namespace.

Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top