@ Thinkster
That shouldn't be necessary for most of the ones you've mentioned, as they are not shortcuts and will not be found in the Desktop folder.
<Edit>
Here is an example, however, of something you could use
@echo off&setlocal enableextensions
for /d %%a in ("%AllUsersProfile%\..\*") do if exist "%%~a\Desktop\*.lnk" call :gothere "%%~a\Desktop"
endlocal&goto :eof
:gothere
pushd %1
for /f "delims=" %%b in ('dir /b/a-d "*.lnk"^|findstr/ivg:"%~dp0lnk2keep.txt"^2^>nul') do if errorlevel 0 del /q "%%~b"
popd&goto :eof
now you will need a txt file named
lnk2keep.txt, to be kept in the same location as this cmd file. Each line of the txt file will contain the names of the files you wish to keep.
example:
Firefox.lnk
Real Player.lnk
SpywareBlaster.lnk
With the above, all *.lnk files found on 'all users desktops' will be deleted unless they match the names listed in the text file.
</Edit>
This post has been edited by Yzöwl: 01 August 2005 - 05:00 AM