1.) There are two kinds of shortcuts that may be present; shortcut files, controlled by the user, and Desktop Icons, controlled by Windows.
2.) Shortcut files may be located in either the user's or the All User's account, resulting in two places to check.
3.) The user's profile location varies based on both username and operating system. Thus, you'll need to use a relative path, not an absolute path.
4.) The shortcut filename(s) can be anything, so you can not delete it programmaticly that way.
5.) Desktop Icons are set by a registry entry, not a file. Thus, you'll have to edit that in your batch file too.
In short, the only guaranteed way is to delete them manually.
Was this reply helpful? (0) (0)