Monday, October 1, 2012

Windows 7 'disappearing' desktop icons


One 'problem' that has come up within our win7 user group already is the fact that desktop icons mysteriously 'disappear' by themselves. There one minute and gone the next.
It seems it happens more frequently after waking the machine up from suspension/hibernation but also happens at other random times.

After reading up on this, it appears this is caused by the Windows Diagnosis Scheduled Task :
Task Scheduler > Task Scheduler (Local) > Task Scheduler Library > Microsoft > Windows > Diagnosis

A routine in this scheduled task checks desktop icons for broken links and allows for up to 4 before 'cleaning' them up and deleting them!

So this activity is by design however seems to be poorly thought through and causing us some problems.

At the time of my posting, I do not know if there is a better fix (although our machines are currently win7SP1 builds with all MS patches) but there is a workaround

The first one which seems a bit overkill is to disable the diagnosis task altogether - not ideal as the task does other stuff too - but it will stop this routine.

Secondly - if you open this location: C:\ Windows\ Diagnostics\ Scheduled\ Maintenance
You can take ownership of the file TS_BrokenShortcuts.ps1 - and edit it to increase the number of broken  shortcuts before it starts to delete.
Line 44 in this file has the entry :  -gt 4
Just increase the number 4 to something much higher and then your desktop icons should be safe from the cleanup.