CODE: [Copy to clipboard]@echo off for /f "tokens=1-4 delims= " %%a in ('sc query schedule ^|findstr /i "STATE"') do ( set A3=%%d ) echo %A3%