1.

Solve : delete al files exept .exe?

Answer»

hi, i WOULD like to delete the whole temp folder, exept the exe files. My os is windows xp and i would like to have the whole folder cleant, but the .exe's must be still thereDidn't we just do this?

Code: [SELECT]
@echo off
for /f %%a in ('dir /b "c:\Temp\*.*"') do (if not %%~xa==.exe del "c:\Temp\%%a")


There are a few Temp folders on an XP machine. Change C:\Temp to the ONE you want. The code is wriiten for inclusion in a batch file.

Hope this helps.

Standard DISCLAIMER: File and DIRECTORIES deleted with batch files or scripts go straight to dataland; there is no layover in the recycle bin.



Discussion

No Comment Found