If you run Windows 7 you might have noticed that desktop shortcuts disappear with no apparent reason whatsoever. Turns out that System Maintenance is responsible for that. It runs as a weekly maintenance service that affects desktop shortcuts in two ways.
It will first remove desktop shortcuts that have not been used for at least three months. System Maintenance will also remove broken shortcuts on the desktop if there are more than four of them. The problem with the latter is that Windows 7 will recognize shortcuts to disconnected network locations as broken and also shortcuts that link to shell folders.
Microsoft offers two solutions to the problem. The first advice is to keep the number of broken shortcuts below four. This is not always possible due to the problems with broken shortcuts mentioned above.
The second suggestion by Microsoft is to turn off Computer Maintenance:
- Click Start, and then click Control Panel.
- Under System and Security, click Find and fix problems.
- On the left navigation pane, click Change settings.
- Set Computer Maintenance to Off.
All the maintenance tasks are powered by scripts that are located in c:\windows\Diagnostics\Scheduled\Maintenance\. Options are to edit the scripts directly in that directory. The permissions prohibit that the files are edited by the current user.
What we are going to do is to edit the default vaule in the scripts, so the condition in the scripts will never be satisfied and the sctript will not delete anything.
Fixing Windows 7 Desktop Shortcuts Disappearing
Go to C:\Windows\diagnostics\scheduled\Maintenance
The script files are :
TS_BrokenShortcuts.ps1.
and
TS_UnusedDesktopIcons.ps1
Take Ownership option and change the security setting so we can use Notepad to edit it.
Open file TS_BrokenShortcuts.ps1
search for "(Get-ListLength $brokenStartupShortcuts)) -gt 4)"
change 4 to something absurdly large
save file
Open file TS_UnusedDesktopIcons.ps1
search for "if((Get-ListLength $unusedDesktopIcons) -gt 10)"
change 10 to something absurdly large
save file
http://www.ghacks.net/2010/03/30/fix-windows-7-desktop-shortcuts-disappearing/