for /f %%i in ('%SystemRoot%\Sysnative\query user') do (set uconsole=%%i) Set uconsole=%uconsole:~1% Echo %uconsole%