首页 > 代码库 > C段常用的批处理有哪些?
C段常用的批处理有哪些?
检测管理员上线就注销自已:
1 2 3 4 5 | @echo off :check choice /C YN /T 10 /D Y quser find "#16" && del xx.bat logoff goto check |
每次运行这个 bat 的时候先quser 一下,看当前的会话id 是多少,然后加1 每连接一次就会加1。以上适应使用管理员帐号时。
下面适应使用拥有管理员权限的其他帐号:
1 2 3 | @echo off logoff 1 del log.bat |
logoff后面的1改成自己登陆的ID号,用query user查看
还有一个是防止嗅探过程中把服务器挂掉:
1 2 3 4 5 6 7 8 9 10 11 | @rem pinggw.bat Createdby Icerain @echo off echo ping... :ping ping 127.0.0.1 -n 20>nul ping -n 1 192.168.1.1 |find "Reply" if %ERRORLEVEL%==0 goto :ping else goto :taskkill :taskkill taskkill /f /im Cain.exe end |
手动观察丢包率防止当机:
1 2 3 4 5 6 7 | :ping choice /C YN /T 120 /D Y ping g.cn IF ERRORLEVEL 1 GOTO reboot IF ERRORLEVEL 0 GOTO ping :reboot shutdown /r /t 0 |
Popularity: 5% [?]
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。