We have found that many of our desktop users (despite our warnings) continue to place files/folder on their desktop instead of shortcuts *to* those files/folders. We explain that files stored on their local computer are not backed up...and anything that is important should be saved to the network (which is backed up nightly). Additionally, for people that have roaming profiles, "carrying around" their desktop files makes for large profiles and thus slowing down their login/logout times.
To help remedy this situation, I wrote this utility, DesktopClean.exe, that will scan the local desktop folders (the user's profile and the All Users profile), and *MOVE* any non-shortcut files ( *.lnk, *.nal, *.pif, *.txt ) to a specified network path, then create shortcuts to those moved files onto their desktop.
If files were found to be moved, an additional shortcut will be created
on the desktop
...which will prompt them with this "reminder":
This can be manually run as needed, or launched during the login process.
SYNTAX: Desktopclean (Network_Path) [ NOTIFY | QUIET | VERYQUIET | NOINFO]
Clean user's desktop of non-shortcut items. Specify the path (Network_Path) to where items should be moved, for example:
DesktopClean "H:\Moved from Desktop"
To display a custom message for the information shortcut that is created if items are found to be moved, simply create a .TXT file of the same name and in the same directory as the executable, EG:
Use the variable, %NetDir%, within the text file and it will be replaced with the directory name where the files were moved to.
10-4-05 Update: I had a Czech request a modification to DesktopClean in order to accommodate the different language name for "Desktop"...which is "Plocha" by the way. So, this update refers to the registry for the name of the desktop folder instead of it being hard-coded.
10-6-05 Update: URLs are now excluded from being moved.
- Verifies destination has enough room for the move. If not, it will throw up a Warning message (for each file/directory it couldn't move) that will time out after 5 seconds if no response. To suppress these messages, you can use the QUIET parameter. Also, there is a VERYQUIET parameter that will suppress all message windows.
- Has a file copy progress meter for large file/directory moves.
- When moving same-named directories or files, the destination directory and/or file, will be "generationally renamed" before the desktop copies are moved, resulting in something like this:
This way, the same shortcut created on the desktop will still correctly point to the most recent file/directory that was moved. Previous "versions" of the moved file/directory are generationally renamed, *.--1, *.--2, *.--3, etc. with *.--1 being the most recent, *.--3 being the oldest.
Comments and suggestions welcomed: email@example.com
(NOTE FROM AUTHOR: Thanks to Debbie Carraway for her valuable suggestions and excellent testing!)
(NOTE FROM AUTHOR: Thanks to Russell from New Zealand for making DesktopClean even better!)