I'm creating a bat to remove all .exe files from my desktop and downloads folder (which sometimes accumulate from so many downloads) ...
call:delfiles "*.exe"
exit
:: funcion delfiles
@echo off
pause
goto:eof
:delfiles
set delfiles=%1
attrib -h -s -r +a "%USERPROFILE%\Downloads\%delfiles%"
attrib -h -s -r +a "%USERPROFILE%\Desktop\%delfiles%"
del /f /q "%USERPROFILE%\Downloads\%delfiles%"
del /f /q "%USERPROFILE%\Desktop\%delfiles%"
goto:eof
But I need to exclude just one "example.exe" located in these folders. How can I do it?
But I need to exclude one "example.exe" located in these folders. How can I do it?