Tuesday, August 28, 2007

Help Help My Shortcut's Repressed!

Well here is another quirky thing that happened on the way to the getting work done. My friend was using Windows XP sp2 when he suddenly noticed he could not right click on the desktop and create a new shortcut. Google searches returned nothing for a fix on this, so I resorted to some trickery to try to find out what was actually launching the shortcut wizard. I fired up Spy++ (included with Visual Studio .NET) and found that the process for the shortcut window was "RunDll32.exe" . Now we're getting somewhere. RunDll32.exe is basically a kickstart for other programs (DLLs). Now a Google search on RunDll32 and shortcut returned this url:

Now he was able to run the command:
RunDll32.exe AppWiz.Cpl,NewLinkHere c:\

and it actually popped up the wizard! So now we have a couple options - create a bat file on the desktop that just calls this wizard or actually get to the root of the problem and fix it. We choose the latter. Most quirky windows problems stem in the registry so I did a find for: "NewLinkHere" and the first place that popped up was:
HKEY_CLASSES_ROOT\.lnk\ShellNew

It has the following REG_SZ (string) entry:
Name: Command
Data: rundll32.exe appwiz.cpl,NewLinkHere %1

Luckily this was missing from his registry. Once he added it, it worked! Just for stuff and giggles a second find in the registry returned the same string in the location:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lnk\ShellNew


So if you find you are missing the Wizard of Oz er Shortcuts, check your registry.

No comments: