@echo off color a net stop winmgmt set folder="C:\Windows\System32\wbem\Repository" cd /d %folder% for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q) net start winmgmt pause