COM WSH - About the IWshShortcut method (SOS!)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

It appears I can only create a shortcut for files that exist?

Are the shortcuts actually registry entries?

I am tasked with programmatically creating shortcuts for files that will
exist on another server. The .lnk files will be accessed from a share. If
they are registry entries than I guess they are forever tied to the machine
that they were created on?

What is the best way to go about making stand alone .lnk files if possible?
 
SuperDrone said:
Are the shortcuts actually registry entries?

I'm no expert on shortcuts but I know a little about them.

Shortcuts are just files. If you create a shortcut (called "Test") on your
root C: drive and then open a CMD window and run a DIR command, you'll see
that the shortcut is just a file with a ".lnk" (link) extension. You can
rename the file Test.lnk as Test.txt (from the CMD prompt -- not in Windows)
and then you'll see the file properly from within Windows.

If you open the file in a binary editor you'll see that it's just a binary
file with the target file location stored within it.
What is the best way to go about making stand alone .lnk files if
possible?

If you're failing to find an API that'll let you create a link to a
non-existent file, the .lnk file format itself is documented so you could
consider manufacturing one by hand. It may be more work but you've got
complete control over what goes in it that way.

Search for lnk files on the Wotsit's Format site (http://www.wotsit.org) and
you'll find several documents explaining the format of the file.

Hope that helps,
 
Thanks dude, that give me a start. I may code a binary reader and make my own
library.

I think I may have another solution but thanks for the info =)
 
Back
Top