Skip to content

Instantly share code, notes, and snippets.

@caiguanhao
Created April 21, 2014 12:59
Show Gist options
  • Save caiguanhao/11142038 to your computer and use it in GitHub Desktop.
Save caiguanhao/11142038 to your computer and use it in GitHub Desktop.
BATs
(echo @echo off
echo shutdown.exe -r -t 00) > "C:\Documents and Settings\Administrator\桌面\一键重启.bat"
(echo @echo off
echo|set /p="for /f "tokens=3 delims= " %%a in ('query user ^| more +1 ^| findstr /B /C:"
echo|set /p="" ""
echo|set /p="') d"
echo|set /p="o logoff %%a") > "C:\Documents and Settings\Administrator\桌面\一键注销其他用户.bat"
(echo @echo off
echo|set /p="for /f "tokens=3 delims= " %%a in ('query user ^| more +1 ^| findstr /B /C:"
echo|set /p="" ""
echo|set /p="') d"
echo|set /p="o logoff %%a"
echo.
echo|set /p="for /f "tokens=3" %%a in ('query user ^| more +1') d"
echo|set /p="o ( logoff %%a )") > "C:\Documents and Settings\Administrator\桌面\一键注销全部用户.bat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment