无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 3840|回复: 18
打印 上一主题 下一主题

大大们帮个忙~~

[复制链接]
跳转到指定楼层
1#
发表于 2010-7-29 22:41:25 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
:Recall
set choice=
set /p choice=请输入执行选项:
if not "%Choice%"=="" set Choice=%Choice:~0,1%
if /i "%choice%"=="1" goto One
if /i "%choice%"=="2" goto Two
if /i "%choice%"=="3" goto Byebye
Echo                                   输入错误,请重新输入!
Echo.
goto Recall
:One
for %%i in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%i:\Autorun.inf /S /Q
                              Md %%i:\Autorun.inf
                              Md "%%i:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
                              Attrib +A +S +H +R %%i:\Autorun.inf /S /D
                              Del %%i:\*.exe /F /Q /A RSHA
                              Del %%i:\*.lnk /F /Q /A RSHA
                              Del %%i:\*.vbs /F /Q /A RSHA
                              Del %%i:\*.dll /F /Q /A RSHA
)
Goto :Byebye
:Two
cls
for %%o in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%o:\Autorun.inf /S /Q
                              Md %%o:\Autorun.inf
                              Md "%%o:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
                              Attrib +A +S +H +R %%o:\Autorun.inf /S /D
                              Del %%i:\*.exe /F /Q /A RSHA
                              Del %%i:\*.lnk /F /Q /A RSHA
                              Del %%i:\*.vbs /F /Q /A RSHA
                              Del %%i:\*.dll /F /Q /A RSHA
                              Del %%i:\*.url /F /Q /A RSHA
                              Del %%i:\*.inf /F /Q /A RSHA
                              Del %%i:\*.ini /F /Q /A RSHA
)
Goto :Byebye
:Byebye
Del %0

为什么goto到two没有用呢?
还有del命令还可以减少吗?
del %%i:\*.exe;%%i:\*.dll   这样可以吗?
19#
发表于 2010-7-30 08:17:50 | 只看该作者
5楼就 指出了,到了17楼才改对,晕。相当于白说了。
回复

使用道具 举报

18#
发表于 2010-7-30 07:25:55 | 只看该作者
个人感觉这个文件夹几乎没用处! 在xp下可以直接重命名autorun.inf文件夹 不信,楼主自己试试看!
回复

使用道具 举报

17#
 楼主| 发表于 2010-7-29 23:57:38 | 只看该作者
:recall
set choice=
set /p choice=请输入执行选项:
if not "%Choice%"=="" set Choice=%Choice:~0,1%
if /i "%choice%"=="1" goto one
if /i "%choice%"=="2" goto two
if /i "%choice%"=="3" goto byebye
Echo                                   输入错误,请重新输入!
goto recall
:one
for %%i in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%i:\Autorun.inf /S /Q
                              Md %%i:\Autorun.inf
                              Md "%%i:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
                              Attrib +A +S +H +R %%i:\Autorun.inf /S /D
for %%o in (exe lnk vbs dll) do ( if exist %%i:\*.%%o (
                              Del %%i:\*.%%o /F /Q /A RSHA
                      )
            )
   )
goto :byebye
:two
for %%i in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%i:\Autorun.inf /S /Q
                              Md %%i:\Autorun.inf
                              Md "%%i:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
                              Attrib +A +S +H +R %%i:\Autorun.inf /S /D
for %%o in (exe lnk vbs dll url inf ini) do ( if exist %%i:\*.%%o (
                              Del %%i:\*.%%o /F /Q /A RSHA
                      )
            )
   )
goto :byebye
:byebye
Del %0

再帮忙看看,没问题了吧????
回复

使用道具 举报

16#
 楼主| 发表于 2010-7-29 23:50:09 | 只看该作者
%%p不能??
那换那个?
if exist 可不可以不加
直接del呢?
回复

使用道具 举报

15#
发表于 2010-7-29 23:48:35 | 只看该作者
for %%p in (exe lnk vbs dll) do ( if exist %%i:\%%p (
                              Del %%o:\%%p /F /Q /A RSHA


这儿也有,你写的只是扩展名,所以只能取扩展名,不能写%%P
回复

使用道具 举报

14#
 楼主| 发表于 2010-7-29 23:48:21 | 只看该作者
\ 要去掉?
为啥子?
回复

使用道具 举报

13#
发表于 2010-7-29 23:47:23 | 只看该作者
原帖由 recall_hy 于 2010-7-29 23:40 发表
for %%i in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%i:\Autorun.inf /S /Q
                              Md %%i:\Autorun.inf
                              Md "%%i:\Autorun.inf\回憶专用免疫文件夹(无害)..\\ ...



   Del %%o:\%%p /F /Q /A RSHA
这儿有错!
回复

使用道具 举报

12#
 楼主| 发表于 2010-7-29 23:40:26 | 只看该作者
for %%i in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%i:\Autorun.inf /S /Q
                              Md %%i:\Autorun.inf
                              Md "%%i:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
                              Attrib +A +S +H +R %%i:\Autorun.inf /S /D
for %%p in (exe lnk vbs dll) do ( if exist %%i:\%%p (
                              Del %%o:\%%p /F /Q /A RSHA
                      )
            )
   )

这句话有错?

[ 本帖最后由 recall_hy 于 2010-7-29 23:41 编辑 ]
回复

使用道具 举报

11#
 楼主| 发表于 2010-7-29 23:33:24 | 只看该作者

回复 #10 cxmzlxb 的帖子

哈哈应该找到地方了,第一句for是执行了,two里的%%i是上句的定义~~
晕了.哈哈~
回复

使用道具 举报

10#
发表于 2010-7-29 23:29:37 | 只看该作者
:Two
cls
for %%o in (c,d,e,f,g,h,i,j,k,l) do ( Rd %%o:\Autorun.inf /S /Q
                              Md %%o:\Autorun.inf
                              Md "%%o:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
                              Attrib +A +S +H +R %%o:\Autorun.inf /S /D
                              Del %%i:\*.exe /F /Q /A RSHA
                              Del %%i:\*.lnk /F /Q /A RSHA
                              Del %%i:\*.vbs /F /Q /A RSHA
                              Del %%i:\*.dll /F /Q /A RSHA
                              Del %%i:\*.url /F /Q /A RSHA
                              Del %%i:\*.inf /F /Q /A RSHA
                              Del %%i:\*.ini /F /Q /A RSHA
)

不知道%%i 从哪来,FOR中明明定义的是%%o ,明显错误,和你一起糊涂了!!
回复

使用道具 举报

9#
 楼主| 发表于 2010-7-29 23:28:54 | 只看该作者

回复 #8 cxmzlxb 的帖子

two单独执行是没有问题的...非常郁闷~
回复

使用道具 举报

8#
发表于 2010-7-29 23:23:27 | 只看该作者
原帖由 recall_hy 于 2010-7-29 23:16 发表
对调肯定可以啦,就是是要two执行,one和two单独执行都可以,就是这样搞选择就是不跳two~


跳转完全没问题,主要检查TWO的命令执行情况。
回复

使用道具 举报

7#
 楼主| 发表于 2010-7-29 23:16:54 | 只看该作者

回复 #5 dos时代菜鸟 的帖子

对调肯定可以啦,就是是要two执行,one和two单独执行都可以,就是这样搞选择就是不跳two~
回复

使用道具 举报

6#
发表于 2010-7-29 23:11:57 | 只看该作者
FOR %%o IN (c,d,e,f,g,h,i,j,k,l) DO (
for %~bI in (exe lnk vbs dll url inf ini) do (
IF EXIST %%o:\%%b (
DEL %%o:\%%b  /A /F /Q RSHA
Rd %%o:\Autorun.inf /S /Q
Md "%%o:\Autorun.inf\回憶专用免疫文件夹(无害)..\\\"
Attrib +A +S +H +R %%o:\Autorun.inf /S /D
           )
       )
  )>nul 2>nul

试下,没做验证,不知道对不对!
回复

使用道具 举报

5#
发表于 2010-7-29 23:08:34 | 只看该作者
顺序调换一下在测试看看:


Tow 中
Del %%i:\*.exe /F /Q /A RSHA

Del %%o:\*.exe /F /Q /A RSHA

[ 本帖最后由 dos时代菜鸟 于 2010-7-29 23:11 编辑 ]
回复

使用道具 举报

4#
 楼主| 发表于 2010-7-29 23:07:14 | 只看该作者
if %choice% LEQ 3 do Echo
下面的也标出来行不~~
有点看不懂~~
回复

使用道具 举报

3#
发表于 2010-7-29 23:02:09 | 只看该作者
另外DEL 可以用FOR 来写,这样可以少一些!
回复

使用道具 举报

2#
发表于 2010-7-29 22:58:36 | 只看该作者
如果只有1 2 3 4 5 6 这样的,可以这样写:
set choice=
set /p choice=请输入执行选项:
if %choice% LEQ 3 do Echo                                   输入错误,请重新输入!|goto Recall


LEQ 的意思就是小于等于, 如果还有字母,就不能这样写了!


呵呵,写错了,按这种方法写,可能更复杂,而且不便于理解。

[ 本帖最后由 cxmzlxb 于 2010-7-29 23:16 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-10-1 19:23

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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