Fixing Disappearing Desktop Shortcuts in Windows 7

AID: 4513
  • Status: Published

12782 points

  • By
  • TypeTips/Tricks
  • Posted on2011-02-14 at 16:31:40
Awards
  • Community Pick
  • Experts Exchange Approved
If you've occasionally noticed missing shortcuts from your Windows 7 Desktop, it's because Windows 7 runs maintenance tasks periodically and cleans up things that don't work.  One of these tasks is to clean up and remove broken shortcuts on your desktop.  If you have more than 4 or more broken shortcuts, on the desktop when the maintenance occurs, Windows will automatically delete them (after all, who wants broken shortcuts on their desktop).

What does Windows consider a broken shortcut?  A shortcut to a file that's no longer available, a shortcut to a network drive that's no longer available, or a shortcut to a program that's no longer available would all be examples.  People who create a shortcut to a work report on their desktop at home that they access via VPN would be considered broken if the maintenance routines run when they are not connected to the VPN.  A shortcut to the network drive that contains all your office files on your office server would be considered broken if it were on a laptop that was taken on a trip.  A shortcut to a program that you placed on the desktop but since have uninstalled would also be considered broken.  And if you have more than 3 of these TOTAL, then Windows will delete them all, by default, when the maintenance is done.

Microsoft suggests two things to prevent this in their support article (Desktop shortcuts disappear in Windows 7; KB 978980) on the subject - neither of which seems very appealing.  
1
Don't put shortcuts on your desktop that can be broken at times (this suggestion, to me, is silly at best)


2
Disable the System Maintenance troubleshooter, which will disable all the maintenance tasks that it performs (this seems extreme and generally unwise)



As a third option, you can do the following - just be careful, any time you modify system settings one wrong keystroke at the wrong time could have seriously damaging results:
1
Take Ownership of the file C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1


2
Adjust the permissions on the file same file so that your user account has full control


3
Right-click and select "edit" on the file - OR open notepad with administrative rights and then open the file in notepad.
Then change the file so that lines 12 through 20 begin with a # symbol - like this:

#    Get-ChildItem -Path $path -filter *.lnk | Foreach-Object {
#        $fullPath = ConvertTo-WQLPath $_.FullName
#        $wmiLinkFile = Get-WmiObject -query "SELECT Name,Target,AccessMask FROM Win32_ShortcutFile WHERE Name = '$fullPath'"
#
#        if(-not(Test-ValidLink $wmiLinkFile) -and (Test-Delete $wmiLinkFile))
#        {
#            $list = AttachTo-List $list $wmiLinkFile.Name
#        }
#    }
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window



4
Save the file



That should do it.  You've just changed the script that does the desktop cleanup so that whenever it runs, it should find no broken links at all - the function that would have found them should always return an empty list.  (The # comments out the line so, if you ever want to restore the functionality, you just need to remove the # symbols starting each of those lines - just be careful not to remove them from lines 1, 3, or 8 as those are actual "FYI" comments that belong there - like little notes explaining what's going on)

I found similar instructions on the internet, but decided to provide this version since I preserve the file in a state you can easily restore later; the other instructions I've found tell you to delete those lines and my philosophy is that it's always easier to undo something commented out than to recreate it or copy it from another system.
Asked On
2011-02-14 at 16:31:40ID4513
Tags

Windows 7

,

Desktop Shortcuts

Topic

Windows 7

Views
6056

Comments

Author Comment

by: leew on 2011-02-15 at 00:24:04ID: 23859

And thanks WaterStreet

Expert Comment

by: wmandallp on 2011-08-23 at 06:17:32ID: 30886

The specific issue seems to be when a user goes above 4 shortcuts which saw that there is an issue with a limitation of WMI class in windows 7.

However, the issue ONLY arises on stations which only have "power user" rights assigned to the local box.  Anyone with "admin or full rights" to the local box can create as many shortcuts as they want and they never disappear.  But the power user creates 4 shortcuts they are fine but when they create the 5th or more shortcuts, that makes all their shortcuts disappear either the next day or in a day or two.

If it is a limitation issue then why the seeming permissions affecting the issue?

Author Comment

by: leew on 2011-08-23 at 06:53:45ID: 30888

I wrote this up after one client experienced this.  However, that client makes the users Admins, NOT Power Users.  Personally, I have not seen the issue myself.  As the KB article makes no mention of user rights and permissions, I would suggest you take a closer look because it would seem the problem should occur to EVERYONE.

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Windows 7 Experts

  1. Run5k

    533,641

    Sage

    5,632 points yesterday

    Profile
    Rank: Genius
  2. ve3ofa

    212,070

    Guru

    0 points yesterday

    Profile
    Rank: Genius
  3. ded9

    172,851

    Guru

    0 points yesterday

    Profile
    Rank: Genius
  4. thinkpads_user

    170,266

    Guru

    664 points yesterday

    Profile
    Rank: Genius
  5. nobus

    164,276

    Guru

    668 points yesterday

    Profile
    Rank: Savant
  6. jcimarron

    108,163

    Master

    2,000 points yesterday

    Profile
    Rank: Genius
  7. Merete

    83,469

    Master

    0 points yesterday

    Profile
    Rank: Genius
  8. l33tf0b

    69,723

    Master

    500 points yesterday

    Profile
    Rank: Wizard
  9. motnahp00

    68,969

    Master

    4,000 points yesterday

    Profile
    Rank: Sage
  10. Darr247

    62,370

    Master

    0 points yesterday

    Profile
    Rank: Genius
  11. Callandor

    62,085

    Master

    2,000 points yesterday

    Profile
    Rank: Genius
  12. cwstad2

    60,285

    Master

    0 points yesterday

    Profile
    Rank: Guru
  13. LeeTutor

    59,598

    Master

    10 points yesterday

    Profile
    Rank: Genius
  14. Anuroopsundd

    50,017

    Master

    0 points yesterday

    Profile
    Rank: Sage
  15. garycase

    49,932

    0 points yesterday

    Profile
    Rank: Genius
  16. hanccocka

    49,616

    0 points yesterday

    Profile
    Rank: Genius
  17. McKnife

    48,823

    0 points yesterday

    Profile
    Rank: Genius
  18. CSI-Windows_com

    45,378

    0 points yesterday

    Profile
  19. rindi

    41,667

    3,000 points yesterday

    Profile
    Rank: Savant
  20. leew

    39,803

    10 points yesterday

    Profile
    Rank: Savant
  21. apache09

    37,716

    0 points yesterday

    Profile
    Rank: Genius
  22. dariusg

    35,164

    500 points yesterday

    Profile
    Rank: Genius
  23. RobSampson

    33,450

    0 points yesterday

    Profile
    Rank: Genius
  24. DavisMcCarn

    31,060

    0 points yesterday

    Profile
    Rank: Genius
  25. IanTh

    29,417

    10 points yesterday

    Profile
    Rank: Genius

Hall Of Fame