FindOnClick Command Line Parameters

<< Click to Display Table of Contents >>

Navigation:  FindOnClick > FindOnClick For Advanced Users >

FindOnClick Command Line Parameters

Previous pageReturn to chapter overviewNext page

Using FindOnClick: Command Line Parameters

 
A Definition of the Command Line
 
A Command Line is a space provided directly on the screen where users type specific commands. A CLI (command line interface) is a user interface to a computer's operating system or an application in which the user responds to a visual prompt by typing in a command on a specified line, receives a response back from the system, and then enters another command. The MS-DOS Prompt application in the Windows operating system is an example of the provision of a command line interface. Today, most users prefer the graphical user interface (GUI) offered by Windows or Macs.

 

Using Double-Quotes
 
Parameters are separated by spaces; therefore it’s very important that double-quotes are placed around any parameter that has a space character in it. For example, if you used the following:

 

FindOnClick.exe -path C:\Program Files\

Then it will fail (because it will search the folder C:\Program\ which probably doesn’t exist). You must wrap the parameter in double-quotes:

FindOnClick.exe -path “C:\Program Files\”

This is a requirement of Windows itself. Anything between double-quotes is treated as a single parameter.

FindOnClick Command Line Parameters
 
FindOnClick accepts a number of command line parameters. Using command line parameters you can completely automate searching.

note

Warning: The -data command line parameter (and everything that follows it) is not for manual use. It is created by the program and points at the search settings file created by FindOnClick program inside the settings folder. The settings file is not to be modified manually. Modifying this file can make your FindOnClick program unstable.

 

-path [path]

This is the path to search. For example, the following will search for all files in the C:\Windows\ folder:

FindOnClick -path “C:\Windows\”

You can specify multiple paths, e.g.

FindOnClick -path “C:\Windows\” -path “D:\” -path “\\server\share\path\”

Do not use wildcards (asterisk and question mark). Also make sure the path ends with a trailing backslash. In V1.2 and earlier you could use wildcards, but this is no longer the case. You must now use the new -pname and -fname parameters to specify wildcards.

-pathregex [regular expression]

Important: 2BrightSparks cannot provide technical support for creating regular expressions. FindOnClick uses Perl style regular expressions

 

This is a far more powerful way of searching. A regular expression can be passed which filenames must match. For example, the following retrieves the names of all files that start with a letter from A to J:

FindOnClick -pathregex "c\:\\[a-j]"

It’s important to remember that the backslash is a special character in regular expressions, so whenever one is used you must escape it with another backslash. The same applies to the colon character and others, e.g. full-stop.

Regular expression filename searches are always case insensitive.

If you use the -path and -pathregex parameters then the one specified last on the command line will be used.

-search [search string]

This searches the contents of files for the search string. Note that it only matches ANSI strings. If a string in a file is in Unicode format then it won't match. Also, it doesn't search the contents of files in compressed archives. By default a case insensitive search is performed. Use the -case command line parameter to make a case sensitive search. If you prefer to use regular expressions use the -regex command line parameter.

 

If you use the -search and -regex parameters then the one specified last on the command line will be used.

-regex [regular expression]

Important: 2BrightSparks cannot provide technical support for creating regular expressions. FindOnClick uses Perl style regular expressions

 

This searches the contents of files using the regular expression search string. Note that it only matches ANSI strings. If a string in a file is in Unicode format then it won't match. Also, it doesn't search the contents of files in compressed archives. By default a case insensitive search is performed. Use the -case command line parameter to make a case sensitive search.

 

If you use the -search and -regex parameters then the one specified last on the command line will be used.

-case

Searches made using -search or -regex will be case sensitive. By default searches are case insensitive.

 

-deep

Searches made using -search or -regex will be exhaustive, i.e. searches will be made using ASCII, Unicode (Little Endian and Big Endian), and UTF-8. Note that this can greatly increase the search time. By default searches are only made using ASCII.

 

-pname [path]

Only folders, and files in folders, that match this path will be listed. For example, to only list files and folders in paths called Source on the C: drive:

FindOnClick -path “C:\” -pname “*\source\*”

-fname [filename]

Only files that match this filename will be listed. For example, to only list files with the word test in them on the C: drive:

FindOnClick -path “C:\” -fname “*test*”

-minsize [bytes]

Use this parameter to only list files that are above a certain size. The size is specified in bytes. For example, to find all text files on the C: drive that are 8192 bytes in size or larger:

FindOnClick -path "c:\*.txt" -minsize 8192

-maxsize [bytes]

Use this parameter to only list files that are below a certain size. The size is specified in bytes. For example, to find all executable files on the C: drive that are 32768 bytes in size or smaller:

FindOnClick -path "c:\*.exe" -maxsize 32768

To find all text files that are between 1000 and 2000 bytes (inclusive):

FindOnClick -path "c:\*.txt" -minsize 1000 -maxsize 2000

-minmdate [date]

Use this parameter to only list files that have been modified on or after a certain date. The format of the date is system/locale dependant. If the date you provide is incorrect then an error message will be displayed showing the date format along with an example.

For example, to list all Word document files that were modified on or after 24th June 2006 (this example assumes your system date format is dd/mm/yyyy):

FindOnClick -path "c:\*.doc" -minmdate “24/6/2006”

-maxmdate [date]

Use this parameter to only list files that have been modified on or before a certain date. The format of the date is system/locale dependant. If the date you provide is incorrect then an error message will be displayed showing the date format along with an example.

For example, to list all Excel document files that were modified on or before 12th January 2006 (this example assumes your system date format is dd/mm/yyyy):

FindOnClick -path "c:\*.xls" -maxmdate “12/1/2006”

To find all files there were modified on 18th April 2006:

FindOnClick -path "c:\" -minmdate “18/4/2006” -maxmdate “18/4/2006”

-mincdate [date]

Use this parameter to only list files that have been created on or after a certain date. The format of the date is system/locale dependant. If the date you provide is incorrect then an error message will be displayed showing the date format along with an example.

For example, to list all Word document files that were created on or after 24th June 2006 (this example assumes your system date format is dd/mm/yyyy):

FindOnClick -path "c:\*.doc" -mincdate “24/6/2006”

-maxcdate [date]

Use this parameter to only list files that have been created on or before a certain date. The format of the date is system/locale dependant. If the date you provide is incorrect then an error message will be displayed showing the date format along with an example.

For example, to list all Excel document files that were created on or before 12th January 2006 (this example assumes your system date format is dd/mm/yyyy):

FindOnClick -path "c:\*.xls" -maxcdate “12/1/2006”

To find all files there were modified on 18th April 2006:

FindOnClick -path "c:\" -maxcdate “18/4/2006” -maxcdate “18/4/2006”

-incext [extensions]

Use this parameter to only list files that have certain extensions. The list must be comma-delimited and include the period character. For example, to find all Word, Excel, and Powerpoint files:

FindOnClick -path "c:\" -excext “.doc,.xls,.ppt”

-excext [extensions]

Use this parameter to not list files that have certain extensions. The list must be comma-delimited and include the period character. For example, to find all files that are not programs:

FindOnClick -path "c:\" -excext “.bat,.com,.dll,.exe,.scr,.sys,.vbs”

-attrs [attributes]

Use this parameter to list files that have (or do not have) certain file attributes. This parameter must be used along with the -attrshow parameter (see below). Attributes is a number which is the total of one or more of the following:

Read Only

1

Hidden

2

System

4

Archive

32

Temporary (NTFS only)

256

Sparse File (NTFS only)

512

Reparse Point (NTFS only)

1024

Compressed (NTFS only)

2048

Offline (NTFS only)

4096

Not Content Indexed  (NTFS only)

8192

Encrypted (NTFS only)

16384

-attrshow [usage]

Use this parameter to list files that have (or do not have) certain file attributes. This parameter must be used along with the -attrs parameter (see above). Usage is a number that must be one of the following:

Only list files which have one or more of the attributes

1

Do not list files which have one or more of the attributes

2

Only list files which have all of the attributes

3

Do not list files which have all of the attributes

4

Only list files which have exactly those attributes

5

Do not list files which have exactly those attributes

6

 

For example, to list files which are read-only or hidden:
 
FindOnClick -path "c:\" -attrs 3 -attrshow 1
 
To list files which are not archived:
 
FindOnClick -path "c:\" -attrs 32 -attrshow 2
 
To list files which are read-only and hidden:
 
FindOnClick -path "c:\" -attrs 3 -attrshow 3
 
To list files which are not read-only, hidden, and system files:
 
FindOnClick -path "c:\" -attrs 7 -attrshow 4
 
To list files which are read-only, hidden, and system files (and have no other file attributes set - note that on NTFS systems there may be many files which have the ‘Not Content Indexed’ attribute set and so will not be listed with the following):
 
FindOnClick -path "c:\" -attrs 7 -attrshow 5
 
To list all files which are not read-only, hidden, system files:
 
FindOnClick -path "c:\" -attrs 7 -attrshow 6

-export [filename]

The search results will be saved to the comma-delimited file specified. For example, the following will create a list of all files on the C: drive:

FindOnClick -path "c:\" -export “c:\export.csv”

The file is a Unicode text file that has each row delimited with a comma (,), and a double-quote character (“) is used to quote columns. To import into Excel, for example, open the file from within Excel then specify the correct delimiter and quote character.

By default the column data shown in the user interface is exported (the filename extension and DOS filename columns are never exported). To change this you must use the -exportcols parameter.

Some software, e.g. Microsoft Excel, cannot import more than 65,535 rows of data from a comma-delimited file. To overcome this you can you the -exportsplit parameter.

Unless the -sortcol parameter is used then the data is sorted using the column specified in the user interface. The sort direction in the user interface is also used unless the -sortasc or -sortdesc parameters are used. To remove the header row from the file use the -noheader parameter.

To exit the program immediately after exporting the file you must use the -exit parameter.

To strip paths from the filenames in the export file, use the -stripbase parameter.

-exportcols [columns]

When exporting search results (using -export), by default the same columns shown on the display are exported (the filename extension and DOS filename columns are never exported). You can optionally specify which columns to export. To do this pass a number which is the total of one or more of the following:

Filename

1

Extension (not exported)

2

DOS Filename (not exported)

4

Size

8

Attributes

16

Creation Date & Time

32

Modified Date & Time

64

Last Accessed Date & Time

128

Number of NTFS Streams

256

MD5 Hash Value

512

File Version

1024

MP3 Title

2048

MP3 Artist

4096

MP3 Album

8192

MP3 Year

16384

MP3 Comment

32768

MP3 Genre

65536

 

For example, to export the search results to a file and just include the filename, size, and modification date & time (1 + 8 + 64 = 73):

FindOnClick -path "c:\" -export “c:\export.csv” -exportcols 73

-exportsplit [rows]

When exporting search results (using -export), by default all rows are written to one file. However some software, e.g. Microsoft Excel, cannot import more than 65,535 rows of data from a single comma-delimited file. To overcome this you can you the -exportsplit parameter. For example, to split the export data into one or more files, with each containing a maximum of 65,535 rows:

FindOnClick -path "c:\" -export “c:\export.csv” -exportsplit 65535

If, for example, there were 196,000 rows of data, then the following files would be created:

C:\export.csv (contains rows 1 to 65,535)
C:\export.1.csv (contains rows 65,536 to 131,071)
C:\export.2.csv (contains rows 131,072 to 196,000)

The minimum split value is 1024. Note that if the header is exported (the default) then the header row is counted as a row.

-noheader

When exporting search results (using -export), by default a header row is written as the first line. This contains the column headings. To not export the column headings use the -noheader parameter, e.g.

FindOnClick -path "c:\" -export “c:\export.csv” -noheader

-sortcol [column]

When exporting search results (using -export), by default the data is sorted using the same column as specified in the user interface. Using this parameter you can sort on a different column (use -sortasc or -sortdesc to set the sort direction):

Filename

0

Extension (not exported)

1

DOS Filename (not exported)

2

Size

3

Attributes

4

Creation Date & Time

5

Modified Date & Time

6

Last Accessed Date & Time

7

Number of NTFS Streams

8

MD5 Hash Value

9

File Version

10

MP3 Title

11

MP3 Artist

12

MP3 Album

13

MP3 Year

14

MP3 Comment

15

MP3 Genre

16

 

-sortasc

 

When exporting search results (using -export), by default the data is sorted in the same order as in the user interface. To sort in ascending order use -sortasc

-sortdesc

When exporting search results (using -export), by default the data is sorted in the same order as in the user interface. To sort in descending order use -sortdesc

-exit

By default the program does not terminate (so you can see the search results). If you want the program to exit then use this parameter. For example:

FindOnClick -path "c:\" -export “c:\export.csv” -exit

Note: The exit code (return value) from FindOnClick will be the number of files found, or a value less than zero on error.

-min

By default the program is shown while searching. If you want the program minimized during the search then use this parameter. For example, the following exports the search results to a file (while minimized) and exits once finished:

FindOnClick -path "c:\" -export “c:\export.csv” -min -exit

-showsearch

If neither -path or -pathregex is used then the search window is shown so you can set other search settings before the search is actually done. You can also force the search window to appear, even if a search path is passed, by using this parameter, e.g.

FindOnClick -path "c:\" -minsize 1 -showsearch

Without -showsearch the search would be done immediately without any chance for the user to change the search settings.

-mp3

By default MP3 ID3v1 tag information is not retrieved from MP3 files. Use this parameter to include it in the search results. This will increase the search time.

-ver

By default file version information is not retrieved from executables and DLL’s. Use this parameter to include it in the search results. This will increase the search time.

-hash

By default a files MD5 hash value is not calculated. Use this parameter to include it in the search results. Note that this will greatly increase the search time.

-dupes

Use this parameter to only include duplicated files in the search results. Note that this will greatly increase the search time. This parameter implies -hash, i.e. the following do exactly the same thing:

FindOnClick -dupes
FindOnClick -hash -dupes

-nofolders

If specified then folders will not be included in the search results.

-nofiles

If specified then files will not be included in the search results.

-stripbase [path]

This is used along with the -export command line parameter to strip the path from the output rows. For example, -stripbase "C:\folder\" will remove C:\folder\ from any filename in the export file if it is prefixed with such a path.

-winsearch

If this parameter is used then the much slow standard Windows search routines are used. This is generally only used when there are compatibility issues with the drive being searched.

-drivesab

If this parameter is used then the A: and B: drive are included. Historically those drives refer to floppy disk drives and so are skipped automatically.

 

 

 

All Content: 2BrightSparks Pte Ltd © 2003-2017