此软件在
http://www.highfiber.com/~raster/freeware.htm 有下
简单来说,这个软件最大的特色就是能够对找到的文件进行各种处理
功能太强了,具体请参见软件的帮助
只要将locate.com拷到WINDOWS\SYSTEM32目录下,那么就可以在批处理随意调用了
对于查找硬盘上的EXE文件,然后删除,可以这样用 (以C盘为例)
locate c: *.exe /n /np /k /y
或 locate c:\*.exe /n /np /k /y
参数解释: /n: 将找所的文件以完整路径显示
/np: 显示时不按页停顿,即连续显示
/k: 将找到的文件删除
/y: 直接删除,不需回答YES
(注意:locate默认是从根目录开始搜索,并用自动搜索所以子目录及所以分区
也就是说 locate *.exe 将会搜索所有分区所有目录中的EXE文件
再者,参数大小写不分
)
如果要找几个分区上的文件
locate c: d: f: *.exe /n /np /k /y
如果不要搜索子目录,则加上 /nr参数
如果只是搜索硬盘而不想搜索光驱、软驱、USB盘,则加上参数 /r
举例: locate c:\windows\*.exe /nr 则只搜索c:\windows目录
如果你想搜索到某一特定文件就停止搜索,可以使用参数 /f:n n为数字,表示要搜索几个
举例: locate c:\windows\explorer.exe /f:2 在c:\windows及其子目录中搜索explorer.exe,当搜索到2个时就停止
总之,这个软件太强了,下面附上1个批处理,以供参考
*****************************************************
功能:
- 按所指定文件的年龄,对windows系统所在的根目录,"windows",
"program files" "Documents and Settings"下及其子目录下的
EXE,DLL和SYS文件进行更名
输入 rn 不带参数就可以显示此处理的用法
*****************************************************
@echo off
if "%1"=="" goto help0
::
locate c: d: e: f: g: \*.exe /R /NR /b1"rename" /d:t-%1,t > rnexe.bat
locate c: d: e: f: g: \*.dll /R /NR /b1"rename" /d:t-%1,t > rndll.bat
locate c: d: e: f: g: \*.sys /R /NR /b1"rename" /d:t-%1,t > rnsys.bat
::
locate c: d: e: f: g: \winnt\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \winnt\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
locate c: d: e: f: g: \winnt\*.sys /R /b1"rename" /d:t-%1,t >> rnsys.bat
::
locate c: d: e: f: g: \windows\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \windows\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
locate c: d: e: f: g: \windows\*.sys /R /b1"rename" /d:t-%1,t >> rnsys.bat
::
locate c: d: e: f: g: \progra~1\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \progra~1\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
::
locate c: d: e: f: g: \docume~1\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \docume~1\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
::
call rnexe.bat *.eee
call rndll.bat *.ddd
call rnsys.bat *.sss
echo ... >log.txt
echo rnexe.bat >>log.txt
echo rndll.bat >>log.txt
echo rnsys.bat >>log.txt
goto end0
::
:help0
cls
@echo ***********************************************************************
@echo 功能描述
@echo - 按所指定文件的年龄,对windows系统所在的根目录,"windows",
@echo "program files" "Documents and Settings"下及其子目录下的
@echo EXE,DLL和SYS文件进行更名
@echo ***********************************************************************
@echo 用法
@echo - rn 文件相对当前日期的年龄
@echo 举例如下
@echo rn 0: 只对今天生成的EXE,DLL,SYS等文件进行更名
@echo rn 1: 将今天及昨天生成的EXE,DLL,SYS等文件进行更名
:end0
@echo ***********************************************************************
@echo 文件的变动情况请参见log.txt
@echo.
:end0
This software can be downloaded at
http://www.highfiber.com/~raster/freeware.htm
Simply put, the biggest feature of this software is that it can perform various operations on the found files.
The function is too powerful. For details, please refer to the software's help.
As long as you copy locate.com to the WINDOWS\SYSTEM32 directory, you can call it freely in batch processing.
For finding EXE files on the hard disk and then deleting them, you can use it like this (taking drive C as an example):
locate c: *.exe /n /np /k /y
or locate c:\*.exe /n /np /k /y
Parameter explanation: /n: Display all found files with the full path
/np: Do not pause by page when displaying, that is, display continuously
/k: Delete the found files
/y: Delete directly without asking for YES
(Note: locate defaults to searching from the root directory and automatically searches all subdirectories and all partitions. That is to say, locate *.exe will search for EXE files in all partitions and all directories. Also, the parameter is case-insensitive.)
If you want to find files on several partitions:
locate c: d: f: *.exe /n /np /k /y
If you don't want to search subdirectories, add the /nr parameter.
If you only want to search the hard disk and not the CD-ROM, floppy disk, USB disk, add the parameter /r.
For example: locate c:\windows\*.exe /nr only searches the c:\windows directory.
If you want to stop searching when a specific file is found, you can use the parameter /f:n, where n is a number, indicating how many to search.
For example: locate c:\windows\explorer.exe /f:2 searches for explorer.exe in c:\windows and its subdirectories, and stops when 2 are found.
In short, this software is too powerful. The following attaches a batch processing for reference.
*****************************************************
Function:
- Rename EXE, DLL, and SYS files under the root directory where the Windows system is located, "windows", "program files", "Documents and Settings" and their subdirectories according to the age of the specified files.
Enter rn without parameters to display the usage of this processing.
*****************************************************
@echo off
if "%1"=="" goto help0
::
locate c: d: e: f: g: \*.exe /R /NR /b1"rename" /d:t-%1,t > rnexe.bat
locate c: d: e: f: g: \*.dll /R /NR /b1"rename" /d:t-%1,t > rndll.bat
locate c: d: e: f: g: \*.sys /R /NR /b1"rename" /d:t-%1,t > rnsys.bat
::
locate c: d: e: f: g: \winnt\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \winnt\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
locate c: d: e: f: g: \winnt\*.sys /R /b1"rename" /d:t-%1,t >> rnsys.bat
::
locate c: d: e: f: g: \windows\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \windows\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
locate c: d: e: f: g: \windows\*.sys /R /b1"rename" /d:t-%1,t >> rnsys.bat
::
locate c: d: e: f: g: \progra~1\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \progra~1\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
::
locate c: d: e: f: g: \docume~1\*.exe /R /b1"rename" /d:t-%1,t >> rnexe.bat
locate c: d: e: f: g: \docume~1\*.dll /R /b1"rename" /d:t-%1,t >> rndll.bat
::
call rnexe.bat *.eee
call rndll.bat *.ddd
call rnsys.bat *.sss
echo ... >log.txt
echo rnexe.bat >>log.txt
echo rndll.bat >>log.txt
echo rnsys.bat >>log.txt
goto end0
::
:help0
cls
@echo ***********************************************************************
@echo Function description
@echo - Rename EXE, DLL, and SYS files under the root directory where the Windows system is located, "windows", "program files", "Documents and Settings" and their subdirectories according to the age of the specified files.
@echo ***********************************************************************
@echo Usage
@echo - rn The age of the file relative to the current date
@echo Examples are as follows
@echo rn 0: Only rename EXE, DLL, SYS and other files generated today
@echo rn 1: Rename EXE, DLL, SYS and other files generated today and yesterday
:end0
@echo ***********************************************************************
@echo Please refer to log.txt for the changes of files.
@echo.
:end0