Problem: There are a bunch of .lnk files on the C drive that point to the J: drive, but the J: drive is gone, and the P: drive has replaced it. Various tricks have been done to get the .lnk files to still work anyway, but it's getting annoying, and it's time to just fix the things.
Using Ruby, Python, WSH.JScript or Perl, can you iterate through an entire directory tree of .lnk files and change them so they point to p:/* instead of j:/*? How would you go about it?
Note: This is not a total unknown to me, but I ask the question anyway because the API for managing .lnk files in the ways I've found so far seem too cumbersome to be the best known way of doing this. This is one of those desparate "there's got to be a better way" type questions.
In the WindowsNT Resource Kit there's a command line utility called Shortcut.exe that I'm reliably informed will run under XP/2000/2003 as well. You can use a variety of command line switches to modify existing LNK files to point to new shortcuts.
I found information about it here: http://www.ss64.com/nt/shortcut.html
I daresay it can't be too hard to hunt down the WindowsNT Resource Kit on the Microsoft Website and extract it. It's a command line utility, so you should be able to batch it to loop through all the LNK files and modify them so they're correct.