@echo off set Input=S set /p Input=Please input a number: set Filter=S%Input%echo off >nul 2 >nul rem replace " with > set Filter=%Filter:"=>% echo %Filter%a rem if "%Filter%"=="S " echo and rem ^ if "%Filter%"=="Secho off 2 " echo fan rem > if "%Filter%"=="S off 2 " echo gtr echo %Filter%