CODE: [Copy to clipboard]@echo off for /f "tokens=3" %%a in ('quser') do ( set "PID=%%a" ) echo,%PID%