Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
He asked to remove icons, not files, but he may have meant both.
It really depends on what you are trying to do.
klint's suggestion of just deleting all the files is the (forceful) way to go if you want to remove (delete) files.
There is no easy way to remove icons. The standard ones have known CLSIDs which can be used (with some registry editing) to remove them, but any non-standard ones cannot be removed without first determining it's CLSID.
If you simply want to clear the desktop, there is a hide-icons-on-desktop command when you right-click on the desktop. Like the previous option, you can create a REG file that contains the relevant changes and use a command to merge that into the registry to do that.
--
Alec S.

Synetech: "He asked to remove icons, not files"
When you place a file on the desktop, it shows as an icon. So, to delete icons, you need to delete files.
"just deleting all the files is the (forceful) way to go"
How is it forceful? The /P parameter stands for "prompt." It will not delete anything if you don't ask it to.
"There is no easy way to remove icons. The standard ones have known CLSIDs"
Oh, now I see what you meant. These icons are things like the "My Computer" and "Recycle Bin" icon. So, you're right, they're not easy to delete in a batch file.
It all depends on what Matt meant by an icon. If it's the built-in ones represented by the CLSIDs, then yes it's difficult. If it's user-placed icons (including those created by installing software) then these are just files, which can be removed by the DEL command.
However, some icons are not on the current user's desktop, but in the All Users desktop.

Thanks for the help guys! I ended up finding this
C:
del /q "%AllUsersProfile%\Desktop\Edulog Web Fieldtrip.url"and just changed the name and .url to .lnk depending on the type.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |