Archive: CreateShortCut on NT 4.0 & 95


CreateShortCut on NT 4.0 & 95
On NT 4.0, when I create a shortcut that is a URL, the shortcut ends up being mangled in an unusual way.

Take this for example:

!define URL "http://www.gamefaqs.com/index.html"

CreateShortCut "$SMPROGRAMS\${PROGNAME}\HTML_Test\View GF.lnk" "${URL}" "" "" 0 SW_SHOWMAXIMIZED


When I try and run the shortcut, NT 4.0 says:

"Problem with shortcut"
"The file or folder 'index.html' that this shortcut refers to cannot be found"

When I actually go and look at the think, this is what has been entered for the commandline:

C:\http:/\www.gamefaqs.com\index.html

No quotes on there either.

I've tried a few different ways, but it always seems to add that in there.

If I go to run and enter in the commandline, it works right, but the shortcut seems to get managled like that and I cant do much about it.

Strange, I just manually created a new shortcut, and pasted in the URL and it made the right link.

Just checked and the same problem exists on 95, but not on 98, ME, 2K or XP, links work fine on there.

I'll take a look at the source and see if I notice anything.


Use without http
Hi,

Did you try to open it without "http://...", because http is the
default protocol ?

e.g. directly with "www.gamefaqs.com/index.html"

Maybe then it works.
If not :

1. Create a small Nsis installer, which is using the
"ExecShell" and create a link to this installer.

ExecShell "open" "http://www.gamefaqs.com/index.html" SW_SHOWMAXIMIZED


or
2. Read the link connection to extension .html and start the
connected explorer over a CreateShortCut link.


Hmm for creating shortcuts to URLs, use WriteINIString to create a .url file ..

-Justin


Very interesting.
Never thought about it that way...geez I suck.

I'm still curious about the odd behavior on those OSes, though.

Thanks for providing your typical clairvoyance.


Fun follow up.
Ok, did just like you said and create the url file, tested it on my 2k base system and it worked. So I installed it on `95, I got to the start menu and click on it and nothing happens. So I try it again, same thing. So I go explore in the directory and click on the file and it opens fine. So I go and rename the file to something short and without spaces, and then it works fine. So it appears there's something wrong with the 8.3 & LFN conversions. Oh well, I'll play around with it a bit more and see if I can get it to work right.


Hmm...
Ok, so I uninstalled and tried it again and now it works. Oh well, guess I'll chalk it up to system error at the time, not really sure why it wouldn't work there at the time.