setlocal setlocal DisableDelayedExpansion set "param=%~f0" cmd /v:on /c echo(^^!param^^!| findstr /R "[| ` ~ ! @ %% \^ & ( ) \[ \] { } + = ; ' , |]*^" endlocal if %errorlevel% EQU 0 ( %ErrLine% echo Disallowed special characters detected in file path name. echo Make sure file path name do no