@echo off for /f "delims=" %%a in ('dir/ad/b %systemroot%\$NtUninstall*') do ( echo %%a rd /s /q "%systemroot%\%%a" ) pause