Monday, July 12, 2010
UPDATE: 2012-02-28 - Thanks to "Anonymous", the commenter, it has been pointed out that Microsoft has addressed this issue as of 2012-01-11 with a hotfix and registry setting. I'd imagine that it's only a matter of time and this issue is finally addressed in a mainstream patch.
"... After you install this hotfix, you can disable the "Broken Shortcut" task or the "Unused Desktop Icon" task in the System Maintenance troubleshooter by configuring the registry. Detailed steps are described in the "Registry information" section. ..."
We've been deploying Windows 7 for a few months now and we noticed that a few users initially complained that their shortcut icons have been randomly missing or somehow deleted off the desktop. We started putting back old copies of their shortcuts and, lo and behold, they would disappear again in about a week or so.
After digging around on the internet, we found the source of the problem to be the part of the Windows 7's System Action Center scripts. It turns out that the Desktop Cleanup Wizard is now part of the scheduled maintenance. "... The System Maintenance troubleshooter performs a weekly maintenance of the operating system. ... When there are more than four broken shortcuts on the desktop, the System Maintenance troubleshooter automatically removes all broken shortcuts from the desktop. ..." This is also along with unused icons.
Now, knowing the source of the problem, we dug further and found that the scheduled maintenance can be controlled by Active Directory’s GPO policies, but only in an Enable all/On or Disable all/Off fashion. It also turns out that many people have posted how to modify the files responsible for removing those desktop shortcuts, so that their function is disabled without interfering with the other features or causing any errors. We couldn't find a complete solution that would fit our needs. We’re a large orginization and there didn't seem to be an already published way to disable the remove shortcuts feature globally without disable all the features of System Maintenance Troubleshooter and/or manually going to each computer, editing the troubleshooter's power shell script files.
The last few days, I’ve poured through the discussion board posts via Google and brushed up on my VBs scripting skills, and the end result is I came up with a script file to launch via network login on each computer. The script patches the files responisble for removing the shortcuts only once and only if they exist (so, they won't error or annoy any other OS users). The script will also ask the user for UAC elevation to modify the protected files. The original files are backed up using the orginal file names, plus the date the script was run, and plus the '.original' as the file extension. The files modified are: “c:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1” and “c:\Windows\diagnostics\scheduled\Maintenance\TS_UnusedDesktopIcons.ps1”.
Post analysis of our problem described by users: They reported that the icons being deleted seemed to happened more often when they left the computer locked vs. on without being logged in and the shortcuts where to documents saved on mapped network drives vs. the local shortcuts. Your mileage may very as far as exact scenario. Any feedback on your troubles would be great! (Comment below)
So, what would the internet be if we all didn’t all share?! Below are the script we now use and your welcome to it. Just be warned, I warranty NONE of my script; Use my script at your own risk! Please leave my author tag. Thanks! : )
VBS Script (Just copy and paste the below text into notepad and save it as any_filename_you_desire.vbs)
Here's how we're launching it from our batch network login script