当前位置:DOS资源站资料中心批处理教程 → 查看系统被锁定用户

查看系统被锁定用户

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-5-4 4:16:50

@echo off

cd /d %TEMP%
for %%i in (user2.txt lockedusers.txt) do if exist %%i del %%i
REM Changing the next 4 lines can meet your special require.
net user /domain |find /v "命令成功完成" >user.txt
for /f "skip=6 tokens=1" %%i in (user.txt) do echo %%i >>user2.txt
for /f "skip=6 tokens=2" %%i in (user.txt) do echo %%i >>user2.txt
for /f "skip=6 tokens=3" %%i in (user.txt) do echo %%i >>user2.txt

REM Changing the next line can meet your special require.
echo net user %%1 /domain ^|find "帐户启用               No" >user.bat
echo goto answer%%errorlevel%% >>user.bat
echo :answer0 >>user.bat
echo echo %%1 ^>^> lockedusers.txt >>user.bat
echo goto end >>user.bat
echo :answer1 >>user.bat
echo :end >>user.bat

for /f %%i in (user2.txt) do call user.bat %%i
for %%i in (user.txt user2.txt user.bat) do if exist %%i del %%i
cls

@if exist lockedusers.txt (
date /t >> lockedusers.txt
time /t >> lockedusers.txt
notepad.exe lockedusers.txt
) else (
echo   There is no locked user!
pause
)

  • ·上一篇文章:WINDOWSXP下确定最后的盘符
  • ·下一篇文章:查看工作组
  • ·百度中搜索更多的关于“查看系统被锁定用户”相关内容
  • ·谷歌中搜索更多的关于“查看系统被锁定用户”相关内容
  • ******申明******
  • 本站文章内容有部分为收录网络中其他网友内容,DOS资源站不保证所有的代码都适合你使用。
  • 由于编辑匆忙,有可能造成某些脚本文件出现丢失代码或代码无法运行的情况,请网友根据情况自行修改。
  • 如果能将出错部分反馈给我,那就更好了。