|
Thewindeagle
新手上路

积分 18
发帖 9
注册 2006-11-1 来自 湖南
状态 离线
|
『第 31 楼』:
使用 LLM 解释/回答一下
有人可以解释下那段批处理吗?
谢谢。
Can someone explain that batch script? Thanks.
|
|
2006-11-2 12:13 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 32 楼』:
使用 LLM 解释/回答一下
上面的代码是这样的:
因为这个批处理是删除你指定的盘符下的所有可执行文件,所以批处理首先询问你是否要继续,如果选择y的话,批处理就跳转到":yes"标签处,去执行":yes"标签下面的语句。如果选择n的话,批处理直接跳到文件结尾处,直接退出文件。
然后批处理要求你输入要搜索的盘符,比如输入一个"D",就将"D"赋给了变量a,以执行下面的语句。
此批处理用了for+dir命令,for是执行循环操作的,就是循环执行del命令,而dir加上了"/b/s/a-d"的参数,可以枚举指定的盘符下的所有可执行文件。将枚举到的每个文件都赋给变量%%i,然后del %%i将其删除。
The code above is as follows:
Because this batch script deletes all executable files under the specified drive letter, the batch script first asks if you want to continue. If you choose y, the batch script jumps to the ":yes" label to execute the statements below the ":yes" label. If you choose n, the batch script directly jumps to the end of the file and exits directly.
Then the batch script asks you to enter the drive letter to search. For example, entering a "D" assigns "D" to variable a to execute the following statements.
This batch script uses the for + dir command. for is used to perform loop operations, that is, to execute the del command in a loop. The dir plus the "/b/s/a-d" parameter can enumerate all executable files under the specified drive letter. Each file enumerated is assigned to variable %%i, and then del %%i deletes it.
|
|
2006-11-3 02:00 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 33 楼』:
使用 LLM 解释/回答一下
没有记错的话以前讨论过好多
If I remember correctly, a lot was discussed before
|
|
2006-11-3 07:11 |
|
|
Bee
初级用户
 
积分 44
发帖 16
注册 2006-9-23 来自 广东省
状态 离线
|
『第 34 楼』:
使用 LLM 解释/回答一下
哪我要是将册除改成拷贝呢应该怎么写啊
Then, if I change deletion to copying, how should I write it?
|
|
2006-11-7 01:54 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
『第 35 楼』:
使用 LLM 解释/回答一下
你把DEL 修改为COPY就是了
——————————————————版务纪录——————————————————
执行:不得不爱
说明:一题多发,{在DOS批处理 & 脚本技术(批处理室),DOS疑难解答 & 问题讨论 (解答室),DOS学习入门 & 精彩文章 (教学室)均有相同的主题}
操作:合并3个相同的主题,并且删除楼主的重复帖子
————————————————————————————————————————
Last edited by 不得不爱 on 2006-11-6 at 05:51 PM ]
Just change DEL to COPY.
——————————————————Moderation Record——————————————————
Performed by: Must Love
Explanation: Multiple posting, {there are identical topics in DOS Batch & Script Technology (Batch Room), DOS Troubleshooting & Question Discussion (Help Room), DOS Learning Introduction & Exciting Articles (Teaching Room)}
Action: Merge 3 identical topics and delete the original poster's duplicate posts
————————————————————————————————————————
Last edited by Must Love on 2006-11-6 at 05:51 PM ]
|

我的网络U盘 我的网络第2个U盘
论坛软件下载链接
灵雨飘零论坛
论坛新手必读,所有人的基本行为准则
刷QQ空间人气、留言的小软件 |
|
2006-11-7 05:49 |
|
|
Bee
初级用户
 
积分 44
发帖 16
注册 2006-9-23 来自 广东省
状态 离线
|
『第 36 楼』:
使用 LLM 解释/回答一下
我改过了如果用5楼给的哪个把DEL改成COPY 比喻我要copy 到F:下面的123文件里。
哪我应该怎么写呢请版主好好给我讲下好吗。
I have made changes. If I use the one given on the 5th floor and change DEL to COPY, for example, I want to copy to the 123 file under F:, then how should I write it? Please the moderator explain it to me carefully, okay?
|
|
2006-11-7 08:32 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 37 楼』:
使用 LLM 解释/回答一下
@echo off
set /p a=请输入要搜索的盘符:
echo.
for /f %%i in ('dir /s/b/a-d %a%:\*.exe') do copy %%i F:\123
echo
@echo off
set /p a=Please enter the drive letter to search:
echo.
for /f %%i in ('dir /s/b/a-d %a%:\*.exe') do copy %%i F:\123
echo
|
|
2006-11-7 10:33 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
『第 38 楼』:
使用 LLM 解释/回答一下
@echo off
set /p a=请输入要搜索的盘符:
for /f "tokens=*" %%i in ('dir /s/b/a-d C:\*.TXT') do copy “%%i” F:\123
echo 已经将指定的文件拷贝到F:\123目录。
pause
@echo off
set /p a=Please enter the drive letter to search:
for /f "tokens=*" %%i in ('dir /s/b/a-d C:\*.TXT') do copy “%%i” F:\123
echo The specified file has been copied to the F:\123 directory.
pause
|

我的网络U盘 我的网络第2个U盘
论坛软件下载链接
灵雨飘零论坛
论坛新手必读,所有人的基本行为准则
刷QQ空间人气、留言的小软件 |
|
2006-11-7 10:39 |
|
|
Bee
初级用户
 
积分 44
发帖 16
注册 2006-9-23 来自 广东省
状态 离线
|
『第 39 楼』:
使用 LLM 解释/回答一下
太感谢这么多位了..我可以做到了
Thank you so much, everyone.. I can do it now
|
|
2006-11-8 10:54 |
|
|
chainliq
高级用户
    学无尽止
积分 635
发帖 244
注册 2006-4-15 来自 广西贵港
状态 离线
|
『第 40 楼』:
使用 LLM 解释/回答一下
哈哈,杀这个病毒我比较内行噢
del D:\**.logo1_.exe /s /a /f /q
del c:\**.logo1_.exe /s /a /f /q
自己多改几个盘吧,另外我以前也上传过一个JS脚本来查杀呀,肯定彻底的哦!1
去找找吧!
Haha, I'm quite experienced in killing this virus oh
del D:\**.logo1_.exe /s /a /f /q
del c:\**.logo1_.exe /s /a /f /q
Change a few more disks by yourself, also I uploaded a JS script before to kill it, definitely thorough oh! 1
Go find it!
|
|
2006-11-8 12:05 |
|
|
tclgb
初级用户
  小子
积分 76
发帖 26
注册 2007-6-20
状态 离线
|
『第 41 楼』:
使用 LLM 解释/回答一下
是蛮好用的,可惜对中文路径不支持
大家可以试一下
如果只是为了搜索指定盘条符下的所有可执行文件,可以用以下代码:
@echo off
:putin
set/p var=请输入搜索指定盘条符:
if "%var%"=="" set var=%~d0
if not exist "%var%" cls&echo 您输入的目录不存在,请重新输入!&goto putin
dir /s /b "%var%\*.exe"
pause
Last edited by tclgb on 2007-7-11 at 10:41 AM ]
It's quite useful, but unfortunately it doesn't support Chinese paths.
Everyone can give it a try.
If you just want to search for all executable files under a specified drive letter, you can use the following code:
@echo off
:putin
set/p var=Please enter the drive letter to search:
if "%var%"=="" set var=%~d0
if not exist "%var%" cls&echo The directory you entered does not exist, please enter again!&goto putin
dir /s /b "%var%\*.exe"
pause
Last edited by tclgb on 2007-7-11 at 10:41 AM ]
附件
1: locate.zip (2007-7-11 10:06, 87.19 KiB,下载次数: 3)
|
|
2007-7-11 10:06 |
|
|
1112yuhua
初级用户
 
积分 106
发帖 44
注册 2007-6-1
状态 离线
|
『第 42 楼』:
使用 LLM 解释/回答一下
多谢上面的兄弟提醒,原来不支持中文路径,
Thanks to the brother above for the reminder, it turns out that Chinese paths are not supported.
|
|
2007-7-29 11:39 |
|