We have an old shortcut that has not deleted itself from a program we no longer use across all of our systems.  Is there a way to script the deletion of that file?  Its on some of the individual users' desktop.
1 Comment   [ - ] Hide Comment


  • Try the scripts posted at

Please log in to comment

Community Chosen Answer


Yes, yes you can.

PowerShell, or your prefered scripting language would be best, NOT batch.

Hopefully the shortcut hasn't been renamed.

How I would go about: search the C:\users directory for the shortcut, if found then delete it. Put a exception in the code for the AllUsers directory.
This might help.

Run the script as local system or some account that has access, SYSTEM would be best as no ACL fiddle will need to be done. 

Answered 01/13/2016 by: rileyz
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity


I ran this .bat file as an offline kscript to delete Office 2013 shortcuts. Not exactly what you are doing but may give you a starting point. 


@echo off

Set scut="C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013"

del /s /q /f %scut%\"InfoPath Designer 2013.lnk"

del /s /q /f %scut%\"InfoPath Filler 2013.lnk"

del /s /q /f %scut%\"Lync 2013.lnk"

del /s /q /f %scut%\"OneDrive for Business.lnk"

del /s /q /f %scut%\"OneNote 2013.lnk"

del /s /q /f %scut%\"Outlook 2013.lnk"

del /s /q /f %scut%\"Send to OneNote 2013.lnk"

Set scut="C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office 2013\Office 2013 Tools"

del /s /q /f %scut%\"Lync Recording Manager.lnk"

del /s /q /f %scut%\"Office 2013 Language Preferences.lnk"

del /s /q /f %scut%\"Office 2013 Upload Center.lnk"

del /s /q /f %scut%\"Telemetry Dashboard for Office 2013.lnk"

del /s /q /f %scut%\"Telemetry Log for Office 2013.lnk"

Answered 01/13/2016 by: rockhead44
Red Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja