Command Line Search - Advanced Options

How to guides and answers to Frequently Asked Questions

Moderator: vuser

Locked
FileViewer
Site Admin
Posts: 287
Joined: Fri Apr 30, 2010 5:50 pm

Command Line Search - Advanced Options

Post by FileViewer »

The following command line options can be used with both /sf and /st commands and correspond to the options available in the Search dialog when the Advanced button is pressed.

Size Options:

Code: Select all

/SL:filesize     Search files less than or equal to filesize
/SG:filesize     Search files greater than or equal to filesize
/SE:filesize     Only search files whose size if equal to filesize

"filesize" can either be a number indicating the size in bytes or it can be a number terminated by one of K, M or G to indicate that the size is in KiloBytes, MegaBytes or GigaBytes, respectively.
Attributes Options:

Code: Select all

/A:[RASHTCEM]       Specify one or more letters after /A: to indicate what attribute you want set (or cleared)

R    Read-Only
A    Archive
S    System
H    Hidden
T    Temporary
C    Compressed
E    Encrypted
M    Alternate Data Stream

Use a 0 (zero) after the attribute letter to indicate that you want the attribute cleared. For example, /A:RD will find all read-only directories whereas /A:R0D will find all directories that are not read only.
Date Options:

Code: Select all

/DM               Use Modified Date (default)
/DA               Use Accessed Date
/DC               Use Created Date
/DT               Set "today" option
/DP:nnn           Previous nnn time units 
/D1:d1 /D2:d2     Dates between d1 and d2
/DI:              Inverts the date search

For the /DP option, nnn can be a number indicating the amount of time in minutes or it can be a number terminated by one of M, H, D, N or Y indicating minutes, hours, days, months or years, respectively.
Examples:

Code: Select all

V /sf /s C:\ *.mpg /sg:1g                           ; Find all .mpg files on C: that are at least 1GB in size
V /sf /s C:\ *.bak /a:d                             ; Find all directories on C:\ that end in .bak
V /sf * /a:r0                                       ; Find all files (or directories) in the current directory that are not read-only
V /sf /s /dt C:\ *.cpp                              ; Find all files on C: that were modified today
V /sf /s /dc /dp:1h C:\ *.bak                       ; Find all .bak files on C: that were created in the last hour
V /sf /s /d1:01/01/2009 /d2:01/31/2009 C:\ *.cpp    ; Find all .cpp files on C:\ that were last modified in January 2009
Locked