January 31, 200818 yr Hi.Any one know how to delete directories after windows is installed from a batch file? I have searched but have not found anything Some of the directories i want to delete are from some silent application installs which has left some directories, most of them have '.tmp' at the end so i would like to be able to search for directories like these and then delete them.Many Thanks for any help.Worf
January 31, 200818 yr Here's an excerpt from my one of my own scripts.REM DELETE SHORTCUTSDEL /F /Q "%AllUsersProfile%\Start Menu\Set Program Access and Defaults.lnk">NULDEL /F /Q "%AllUsersProfile%\Start Menu\Windows Catalog.lnk">NULDEL /F /Q "%AllUsersProfile%\Start Menu\Windows Update.lnk">NULDEL /F /Q "%UserProfile%\Start Menu\Programs\Accessories\Tour Windows XP.lnk">NULREM DELETE FOLDERSRD /S /Q "%AllUsersProfile%\Start Menu\Programs\Powertoys for Windows XP">NULRD /S /Q "%UserProfile%\Start Menu\Programs\Powertoys for Windows XP">NULRD /S /Q "%ProgramFiles%\Common Files\Services">NULRD /S /Q "%ProgramFiles%\Online Services">NULRD /S /Q "%SystemRoot%\$Nt*$">NULRD /S /Q "%SystemRoot%\setup.pss">NULREM DELETE SAMPLE CONTENTDEL /F /S /Q "%UserProfile%\My Documents\My Music">NULDEL /F /S /Q "%UserProfile%\My Documents\My Pictures">NULDEL /F /S /Q "%UserProfile%\My Documents\My Videos">NULREM DELETE FAVORITESDEL /F /S /Q "%SystemDrive%\Documents and Settings\Default User\Favorites">NULDEL /F /S /Q "%UserProfile%\Favorites">NULREM DELETE FILESDEL /F /S /Q "%SystemDrive%\clock.avi">NULDEL /F /S /Q "%SystemDrive%\swtchbrd.bmp">NULDEL /F /S /Q "%SystemDrive%\yahoo.bmp">NULREM DELETE TEMPORARY FILESDEL /F /S /Q %SystemDrive%\~*.*>NULDEL /F /S /Q %SystemDrive%\*.~~~>NULDEL /F /S /Q %SystemDrive%\*.~m~>NULDEL /F /S /Q %SystemDrive%\*.###>NULDEL /F /S /Q %SystemDrive%\*.$$$>NULDEL /F /S /Q %SystemDrive%\*.--->NULDEL /F /S /Q %SystemDrive%\*._mp>NULDEL /F /S /Q %SystemDrive%\*.bk!>NULDEL /F /S /Q %SystemDrive%\*.tmp>NULDEL /F /S /Q %SystemRoot%\*.bak>NULDEL /F /S /Q %SystemRoot%\*.log>NULDEL /F /S /Q %SystemRoot%\TEMP>NULHope this gives you good start
February 1, 200818 yr rd /S /Q "C:\folder"that deletes them, the /S is for removing them even if they have data/subfolders in themthis website is handy http://www.ss64.com/nt/index.html Edited February 1, 200818 yr by bledd
Create an account or sign in to comment