Код:

@echo off
setlocal enableextensions enabledelayedexpansion
call :DelFilesInFolder "D:\"
call :DelFilesInFolder "D:\Papka"
endlocal
exit /b 0
:DelFilesInFolder
setlocal enableextensions enabledelayedexpansion
set sSourceFolder=%~1
pushd "%sSourceFolder%" && (
for /f "usebackq delims=" %%i in (`2^>nul dir /a:-d /b "*.*"`) do if "%%~xi" neq ".lnk" echo del /f /q "%%~i"
popd
) || (
echo Can't find source folder [%sSourceFolder%].
exit /b 1
)
endlocal
exit /b 0