Tags: Windows 7

Issue: Desktop shortcuts keep getting deleted (Windows 7)

Categories: Windows
Comments: No Comments
Published on: 2011/10/14

There is a scheduled task in Windows 7 that runs every Sunday at 1:00 AM which includes, among other maintenance tasks, the deletion of shortcuts that have not been used for more than 60 days. This task also deletes what Microsoft calls “broken shortcuts”. These are shortcuts that point to locations or files that are no longer available on local drives or the network. The problem is that it always assumes shortcuts pointing to the network are not valid when they are pointing to a mapped drive, even when they are valid, and deletes them if there are more than 4. Basically the task is not aware of mapped drives even if the user is logged on, just UNC.


  1. Copy the code below to notepad and save it as resolve_deleted_shortcuts.bat
  2. Right click the script and run as administrator. Enter Administrator password if prompted
  3. Done
@echo off

REM **Script to resolve unused and broken shortcuts deletion issue**
REM **Rules out WinXP and other OS's***
If Not Exist "%SystemRoot%\diagnostics\scheduled\Maintenance" goto RESOLVED
REM **Start processing**
takeown /a /f "%SystemRoot%\diagnostics\scheduled\Maintenance\TS_UnusedDesktopIcons.ps1"
takeown /a /f "%SystemRoot%\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1"
takeown /a /f "%SystemRoot%\diagnostics\scheduled\Maintenance\RS_RemoveShortcuts.ps1"
takeown /a /f "%SystemRoot%\diagnostics\scheduled\Maintenance\RS_RemoveUnusedDesktopIcons.ps1"
icacls "%SystemRoot%\diagnostics\scheduled\Maintenance\TS_UnusedDesktopIcons.ps1" /c /grant *S-1-5-32-544:f
icacls "%SystemRoot%\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1" /c /grant *S-1-5-32-544:f
icacls "%SystemRoot%\diagnostics\scheduled\Maintenance\RS_RemoveShortcuts.ps1" /c /grant *S-1-5-32-544:f
icacls "%SystemRoot%\diagnostics\scheduled\Maintenance\RS_RemoveUnusedDesktopIcons.ps1" /c /grant *S-1-5-32-544:f
md c:\windows\diagnostics_bkp
move "%SystemRoot%\diagnostics\scheduled\Maintenance\TS_UnusedDesktopIcons.ps1" c:\windows\diagnostics_bkp\
move "%SystemRoot%\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1" c:\windows\diagnostics_bkp\
move "%SystemRoot%\diagnostics\scheduled\Maintenance\RS_RemoveShortcuts.ps1" c:\windows\diagnostics_bkp\
move "%SystemRoot%\diagnostics\scheduled\Maintenance\RS_RemoveUnusedDesktopIcons.ps1" c:\windows\diagnostics_bkp\

Deleting a user profile in Windows 7

Categories: Windows
Comments: No Comments
Published on: 2011/03/16

Deleting a profile in Windows 7 needs to be done a bit differently than in Windows XP.


  1. Log on as a Local Administrator
  2. Delete (or rename) profile folder under C:\Users (Example: C:\Users\username)
  3. Run regedit
  4. Navigate to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  5. In the left pane, look for the folder name starting with S-1-5 (SID key) followed by a long number. then click each folder and locate ProfileImagePath from the right pane, double click to verify that this is the user account profile that needs to be deleted/renamed
  6. Delete the S-1-5number key on the left panel
  7. Reboot computer
  8. log on as the user for the new profile to get created.
page 1 of 1

Welcome , today is Wednesday, 2021/05/12