Windows .search-ms file generator.
.search-ms file used to save explorer.exe search query as a file.
the file format is XML based text, but difficult to read/edit by hand.
So the program intend to help creating .search-ms files by easyer way.
tested Windows11 64bit
tested Windows11 64bit. may can use on Windows Vista or later.
- smsgen.exe [input file] [output file]
- smsgen.exe [input file]
for drag&drop. When drop "sample.yaml", generates as "sample.search-ms"
YAML based text, is besed on:
- usually .search-ms XML format's tags/attributes maps to YAML
- for "conditions", using helper notations (like "size", "recent") to
write the structure.
samples below or other sample files are in "sample" directory.
required variables, minimal sample.
"conditions" and "scopes" are required always.
other variables are optional.
conditions:
picture
scopes:
- [ include, "c:/Users/someUser" ]
this query searches picture files in c:/Users/someUser
more detailed conditions, scopes
conditions:
date_recent: { days: 14 }
scopes:
- [ include, "c:/Users/someUser" ]
- [ exclude, "c:/Users/someUser/AppData" ]
- [ include, "d:/data", true ]
this query searches:
- file/folder updated recent 14 days.
- target folders are:
- c:/Users/someUser, but excludes c:/Users/someUser/AppData
- d:/data, but excepts subfolders alike d:/data/someFolder, d:/data/anyFolder
(3rd parameter "nonRecursive" set true).
optional variables.
"viewMode", "iconSize", "columns", "sorts", and "kinds" can be either
skipping to use default value or settting specific one.
viewMode:
details
iconSize:
16
columns:
- { viewField: System.ItemNameDisplay }
- { viewField: System.DateModified }
sorts:
- { viewField: System.DateModified, direction: descending }
conditions:
date_recent: { days: 14 }
kinds:
- item
scopes:
- [ include, "c:/Users/someUser", false ]
this query searches:
- search results displays with details view
- the view's colomns are itemNameDisplay, dateModified
- items sort by dateModified, descending order
these settings may ignored by exploler.exe, because exploler.exe uses internally saved values, outside of .search-ms file.
more ditailed conditions, logical operation.
conditions has tree structure, can present logical operation (and/or/not).
viewMode:
icons
conditions:
and:
- picture
- size: { comparator: gte, size: 1MiB }
- not:
- or:
- extension: { value: .gif }
- extension: { value: .tiff }
scopes:
- [ include, "c:/Users/someUser" ]
- [ exclude, "c:/Users/someUser/AppData" ]
this query searches:
- picture files, and...
- size greater equal than 1MiB, but...
- excludes .gif, .tiff file extensions
conditions has tree structure
conditions:
and:
- picture
- size: { comparator: gte, size: 1MiB }
- not:
- or:
- extension: { value: .gif }
- extension: { value: .tiff }
- conditions's element is just 1 condition operator
- condition operator is mapping (Hash) or scalar (String)
- condition operator mapping's element is one of each below
- child condition operators as sequence (Array)
and, or, not - parameters of itself as mapping
size, extension, ... - none
picture, ...
- child condition operators as sequence (Array)
word: { value: hello }
search by filename, file content
extension: { value: .xlsx }
match file extension
picture
picture sort files like .jpg, .png
folder
folder sort items, folder, folder shortcut (.lnk), zip, so on.
size: { comparator: gte, size: 1MiB }
filesize compare
parameters:
- comparator: string, gte, lte
- size: string, filesize, like 128, 100KB, 10MiB
date_recent: { days: 14 }
recently updated, LastWriteTime
date_between: { start: 2018-01-01, end: 2018-12-31 }
updated between "start" and "end", LastWriteTime
and: []
have few children operators
or: []
have few children operators
not: []
have just 1 child operator