Maybe you noticed that one of my projects I would like to finish in summer is also offline shortcuts editor – and you probably think “why some editor when I can build shortcuts using Explorer?”…
Think twice – it’s not as easy as it looks like and you will be maybe surprised how many gotchas are there.
Problem with .lnk files is that they are WYSINWYG (What You See Is NOT What You Get). Windows is sometimes too “intelligent” – and it can be very, very annoying.
My blog is primarily focused on scripting, deployment and SBC – so I expect that my audience have also some experiences with this. And most people tried to create some shortcut and copy it somewhere else (you create shortcut to some drive letter on your PC and then copy it to desktop of all users for example). Problem is that together with shortcut you provide more information that you know – you provide also last successful resolution of that shortcut and you won’t see this information anywhere in properties of such shortcut.
Let me show you example. You map home drives of your users to H: drive. You want to have shortcut to H:\MyDocs on your desktop. So if you create shortcut to H:\MyDocs, then you just need to distribute it to all your workstations and its done. You open properties of this shortcut and you see that it points to H:\MyDocs, so it should work everywhere, right?
WRONG – don’t forget, Windows can be sometimes unpredictable 😉 If you open properties of your .lnk file, you can see that it is (still) pointing to H:\MyDocs – however .lnk file also contains information that H:\MyDocs is in fact \\Servers\Administrator$\MyDocs and it will automatically open this folder even from different PC! Quite nasty, right?
And thats not all – try to remove that drive letter and open shortcut – because it remembers that location, it will automatically map H: to \\Servers\Administrator$\MyDocs
If you will try to map something else (\\Servers\Projects) to H: drive, Windows will surprise again – not only it will map that shortcut to different drive (X:), but it will also modify your shortcut so it is automatically changed from H:\MyDocs to X:\MyDocs… Which means that if you have 50 shortcuts pointing to H: drive, 1 accidental click can corrupt that shortcut for you.
You can find many (well, not tons of, but still few of them exists) offline shortcuts editors, however most of them covers only situation I described above (and not of all them covers this). There are some bugs that are (as far as I know) not solved by any existing product – for example if you use variables to define your folders (for example %Programs% for D:\Programs), you WON’T be able to create such shortcut if variable is not defined. When you try to create it, C:\ prefix is automatically appended (so %Programs% is in fact pointing to C:\D:\Programs, which is invalid value).
Well, this was just quick overview why I want to have offline editor where all such bugs will be fixed (btw I already have first version of code and it works correctly there, so it must be something in Explorer itself)… There are tons of other bugs – I will try to spend some time testing different results and share results with you. I am now very sorry Microsoft didn’t implement something like XLNK in Windows Vista 🙁