找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 38337|回复: 4

[文本处理] 全盘循环监测是否存在指定文件,如果存在则执行指定操作

[复制链接]
发表于 2009-1-9 19:17:22 | 显示全部楼层 |阅读模式
本帖最后由 pcl_test 于 2017-4-10 07:38 编辑

现发现了一个能破解网吧收费软件的软件,主要是运行一个icon.dll的文件,我想用批处理不停的循环查找到这个文件后就自动关机...


@echo off
:start
ping -n 5 127.0.0.1 >nul
dir /s c:\rfwmain.exe
if errorlevel 1 goto :d
if errorlevel 0 goto :down
:d
dir /s d:\rfwmain.exe
if errorlevel 1 goto :e
if errorlevel 0 goto :down
:e
dir /s e:\rfwmain.exe
if errorlevel 1 goto :start
if errorlevel 0 goto :bb
:down
shutdown -s -t 15 -c "警告!!!你正在试图破解网吧系统!此信息以经发往服务器"
上面的是我原来请别人写的,可现再用这样的不行了....

还请高人给写个,谢谢...
发表于 2009-1-9 21:07:23 | 显示全部楼层
  1. @echo off
  2. :start
  3. ping -n 5 127.0.0.1 >nul
  4. For %%i in (C D E) do ^
  5. dir /s %%i:\rfwmain.exe>nul&&goto start||shutdown -s -t 0
复制代码

[ 本帖最后由 yslyxqysl 于 2009-1-9 21:20 编辑 ]
 楼主| 发表于 2009-1-9 21:50:32 | 显示全部楼层
上面的这位高人,我试试了你发的.
@echo off
:start
ping -n 5 127.0.0.1 >nul
For %%i in (C D E) do ^
dir /s %%i:\SoftInst.exe>nul&&goto start||shutdown -s -t 10

运行以后不管有没有SoftInst.exe这个文件都没有反应啊.

C:\Documents and Settings\daanwm>@echo off
:start
ping -n 5 127.0.0.1 >nul
For %%i in (C D E) do ^
此时不应有 %%i。
dir /s %%i:\SoftInst.exe>nul&&goto start||shutdown -s -t 10...这是我在DOS里运行的结果...
发表于 2009-1-10 14:07:35 | 显示全部楼层
可现再用这样的不行了

也就是说,以前管用过?
发生什么事情以后,这个方法就不管用了呢?
不知这个帖子是否对网吧网管有帮助:http://bbs.bathome.net/viewthread.php?tid=2127
发表于 2009-1-10 22:45:01 | 显示全部楼层

一点小议建

For %%i in (C D E) do ^
dir /s %%i:\rfwmain.exe>nul&&goto start||shutdown -s -t 0
这一句可能是应缺少了“/f”才会出现那样的提示的。你可以试试
For  /f %%i in (C D E) do ^
dir /s %%i:\rfwmain.exe>nul&&goto start||shutdown -s -t 0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 03:36 , Processed in 0.016622 second(s), 7 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表