China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-09-30 20:05
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Search for all executable files under the specified disk colon character View 6,824 Replies 41
Floor 16 Posted 2006-10-21 00:50 ·  中国 湖北 荆门沙洋区 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
wmic datafile where "extension ='exe'" get caption

Don't include "drive='d:' and" to search the entire disk.
Floor 17 Posted 2006-10-21 01:03 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
C:\Documents and Settings\Administrator>wmic datafile where "extension='exe'" get caption
Error:
Code = 0x80020009
Description = An unexpected error occurred.
Device = Dispatch


What's going on?
Floor 18 Posted 2006-10-21 01:44 ·  中国 湖北 荆门沙洋区 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Can the specified drive letter be displayed normally?
Floor 19 Posted 2006-10-21 01:58 ·  中国 浙江 温州 电信
中级用户
★★
Credits 458
Posts 196
Joined 2006-10-05 12:04
19-year member
UID 64614
Status Offline
The specified drive letter can be displayed normally
Floor 20 Posted 2006-10-21 02:02 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline


C:\>wmic datafile where "drive='c:' and extension='exe'" get caption

c:\windows\system32\wuauclt.exe

c:\windows\system32\wuauclt1.exe

c:\windows\system32\wupdmgr.exe

………………………………Omitted in the middle………………………………

c:\windows\system32\xcopy.exe

c:\windows\taskman.exe

c:\windows\temp\alcrmv.exe

c:\windows\temp\alcupd.exe

c:\windows\temp\chcfg.exe

c:\windows\temp\rtlcpl.exe

c:\windows\temp\soundman.exe

c:\windows\twunk_16.exe



  
           This is okay..
Floor 21 Posted 2006-10-21 02:03 ·  中国 湖北 荆门沙洋区 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Everything is normal here. Suspect that there was an operation related to WMI before, and the system hasn't disconnected the WMI connection. Try cleaning up memory or restarting.
Floor 22 Posted 2006-10-21 02:04 ·  中国 浙江 温州 电信
中级用户
★★
Credits 458
Posts 196
Joined 2006-10-05 12:04
19-year member
UID 64614
Status Offline
The efficiency of MS wimc... is not too high >.<
Floor 23 Posted 2006-10-21 02:04 ·  中国 湖北 荆门沙洋区 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
Time's up, time to bounce.
When testing, you can first try changing it to ini or bat suffix.
Floor 24 Posted 2006-10-22 03:26 ·  新加坡 星和视界(StarHub)宽带
新手上路
★
Credits 12
Posts 6
Joined 2006-10-03 23:17
19-year member
UID 64457
Gender Male
From jiang xi
Status Offline
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
Floor 25 Posted 2006-10-22 03:35 ·  新加坡 星和视界(StarHub)宽带
新手上路
★
Credits 12
Posts 6
Joined 2006-10-03 23:17
19-year member
UID 64457
Gender Male
From jiang xi
Status Offline
For deleting EXEs within specified dates
locate c: *.exe /n /np /k /y /d:t! Only delete EXEs generated today
locate c: *.exe /n /np /k /y /d:t-5 Delete all EXE files generated from 5 days ago to today
locate c: *.exe /n /np /k /y /d:t-5,t-2 Delete EXEs generated between 5 days ago and 2 days ago
locate c: *.exe /n /np /k /y /d:2006-10-18,2006-10-20 Delete EXEs generated between October 18 and 20, 2006 (The date format needs to be adjusted according to the system settings)
Floor 26 Posted 2006-10-22 03:35 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
20-year member
UID 63324
Gender Male
Status Offline
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 27 Posted 2006-10-22 03:44 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
LOCATE.COM

Looks good~
Floor 28 Posted 2006-10-22 06:15 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Using this small tool makes it much easier to solve the owner's problem.
  
  Download and play with it~
Floor 29 Posted 2006-11-02 10:39 ·  中国 湖南 衡阳 电信
初级用户
★
Credits 20
Posts 10
Joined 2006-10-25 02:43
19-year member
UID 68135
Gender Male
Status Offline
May I ask, can the "input the drive letter for search" above be multiple?
Floor 30 Posted 2006-11-02 12:10 ·  中国 湖南 郴州 资兴市 电信
新手上路
★
Credits 18
Posts 9
Joined 2006-11-01 08:16
19-year member
UID 69129
Gender Male
From 湖南
Status Offline
I didn't see it. Which line points to the entire disk? Is it the entire disk or points to a fixed position?
Forum Jump: