The CSS HTML Validator command line processor (cmdlineprocessor.exe) can be run from a command prompt and will accept arguments passed to it from the command line.
The executable file to run when using command line arguments is called cmdlineprocessor.exe. This executable understands command line arguments and will call the validator engine (in a DLL) to perform the correct job.
NOTE: In 2022/v22+, a duplicate file named chvcmd230.exe is also included. This is the same file as cmdlineprocessor.exe except the filename is different (the filename is shorter and contains the version). If desired, chvcmd230.exe can be used instead of cmdlineprocessor.exe.
Because processing more than one file at a time using command line arguments is inefficient (unless you use the -f command), we recommend that you use the drag and drop capability or the Batch Wizard to process multiple files. When using the drag and drop capability, the files to process can be dropped onto the Drag and Drop Window of a running instance of HTML Validator. Use File Explorer (previously known as Windows Explorer) to select the files to drop, and make sure that HTML Validator is set up to process the dropped files the way that you want (by validating and/or using a tool) using the Drag and Drop Default Tool Select Dialog Box. |
•If you are executing cmdlineprocessor.exe from a command prompt, then you must include the path to cmdlineprocessor.exe if the folder that contains cmdlineprocessor.exe is not in the search path, otherwise the system will not be able to find cmdlineprocessor.exe. However, you can type the command in the Start | Run dialog box without a path to the executable (in this case, use htmlval.exe instead of cmdlineprocessor.exe; the system will automatically translate htmlval.exe to the correct executable). •If you are executing HTML Validator's editor from a command prompt, then you must include the path to chv230.exe if the folder that contains chv230.exe is not in the search path, otherwise the system will not be able to find the editor. However, you can type the command in the Start | Run dialog box without a path to the executable. •When cmdlineprocessor.exe is run with command line arguments, cmdlineprocessor.exe performs the operation specified by the command line arguments and then immediately exits (unless otherwise noted above for the specific argument). •Be sure to include the full path to filename if it is not in the current folder. •Letters following '-' are not case-sensitive. They may be either uppercase or lowercase such as -l or -L. •When validating a file with cmdlineprocessor.exe, holding down the shift key will cause the page source to be opened in the viewer without validating it. This does not apply when -f is used and only works if the option to enable this functionality is checked in the Validator Engine Options (it is enabled by default). •Link checking can only be done when using the -bx commands for the Batch Wizard. •Use (prepend) "cmd /C" to call cmdlineprocessor.exe when you want to wait until it's finished (perhaps in a batch script) before the command returns. •Do not enclose the executable name and its arguments in the same quoted string when entering the command in a command prompt or in a task scheduler. Quotes are sometimes used in the documentation to delimit the command line and its arguments from the description, and, in this case, are not meant to be used literally. |
IMPORTANT: Specify any options before the primary command (before any -b, -f, -q, etc; see below for the options).
NOTE: There are additional commands that are used for integration with 3rd party products, but they are not listed here. To see those commands, please visit the developer section on our website.
Command |
Description |
---|---|
<filename> |
Validate <filename> using the options set in the Classic Page in the Validator Engine Options |
-1 |
Show the Validator Engine Options Dialog |
-2 |
Show the Configuration Editor Dialog |
-3 |
Show the Batch Wizard Options |
-4 |
Show the Editor Options |
-b |
Open the Batch Wizard |
-b <filename> |
Open the Batch Wizard and process the target list specified by <filename>; see Batch Wizard Commands |
-bx <filename> |
Open the Batch Wizard and process the target list specified by <filename>, where x specifies the tool to use; see Batch Wizard Commands |
-c <filename> |
Use the Convert Text File Format Tool on <filename> |
-e <filename> |
Validate <filename> and output the results; for more information visit the Developer Information Page |
-f <filename> |
Run the commands in <filename>; see Using -f to Execute Commands |
-l <filename> |
Use the Lowercase Tool on <filename> |
-o <filename> |
Open <filename> in the editor (can be a URL starting with http:// or https://) |
-q |
Sends a quit signal to the editor/Batch Wizard |
-s <filename> |
Use the Remove Tags Tool (Strip Tags Tool) on <filename> |
-t <filename> |
Use the Template Tool on <filename> |
-u <filename |
Use the Uppercase Tool on <filename> |
-v <filename> |
Validate <filename> and open the results in the viewer specified in the Validator Engine Options |
-w <URL> |
Open <URL> in the integrated editor (automatically prepends http:// if needed) |
NOTE: Specify options before the main command (before any -b, -f, -q, etc).
Option |
Description |
---|---|
-bwofile <filename> |
Specify a Batch Wizard options export file to load before the main command (New v22.01) |
-debuglog |
Adds the -debuglog option when starting the editor; visit Editor Command Line Arguments for more information |
-inifile <filename> |
Specify an ini file (filename only or with a full path) to store the configuration in (the filename must exist or the option is ignored). This can be used as a way to use different profiles or "workspaces", or to run multiple instances simultaneously and independently. This feature uses "portable mode" with the specified ini file. |
-minimize |
Adds the -minimize option when starting the editor |
-msgwindow <name> |
Specify a custom window name (caption) for the message window. Typically this is only used if you want to run more than one instance of CSS HTML Validator at a time, like when processing multiple Batch Wizard jobs simultaneously. |
-outputfile <filename> |
Specify the output file, overriding the default |
-rx |
Change exit code based on value of x (see below for more information about the -rx option) |
-veofile <filename> |
Specify a validator engine options export file to load before the main command |
-v0 |
Suppress the viewer when doing a validation; place before command argument |
-xi |
XML output override (-x0 - off, -x1 - on) ( |
IMPORTANT: Specify any options before the primary command (before any -b, -f, -q, etc; see below for the options).
•cmdlineprocessor.exe -l <filename> - Use the Lowercase Tool on the file specified by filename. Note that -l is the letter L and not the number one.
•cmdlineprocessor.exe -u <filename> - Use the Uppercase Tool on the file specified by filename.
•cmdlineprocessor.exe -s <filename> - Use the Remove Tags Tool on the file specified by filename.
•cmdlineprocessor.exe -t <filename> - Use the Template Tool on the file specified by filename.
•cmdlineprocessor.exe -c <filename> - Use the Convert Text File Format Tool on the file specified by filename. The format converted to is specified by the last saved program options.
•cmdlineprocessor.exe -1 - (All Editions) Show the Validator Engine Options. HTML Validator exits (does not continue running) when the Validator Engine Options are closed.
•cmdlineprocessor.exe -2 - (Pro,
Home) Show the Configuration Editor. HTML Validator exits (does not continue running) when the Configuration Editor is closed.
•cmdlineprocessor.exe -3 - (Pro,
Home) Show the Batch Wizard Options. HTML Validator will remain running when the Batch Wizard Options are closed.
•cmdlineprocessor.exe -4 - (All Editions) Show the Editor Options. HTML Validator will remain running when the Editor Options are closed.
•cmdlineprocessor.exe -n windowname,messagenum,messageint - This causes HTML Validator to send the message WM_USER+messagenum to the window named windowname. LPARAM will be messageint.
•cmdlineprocessor.exe <filename> - This causes HTML Validator to validate the document specified by filename. HTML Validator may ask you if you want to open the viewer application with the results or may automatically open the viewer, depending on the options set in the Classic Page in the Validator Engine Options. The -rx option can be used with this command to return the number of error messages or error+warning messages (see below). NOTE: Use the -o option to open a file in the integrated editor.
•cmdlineprocessor.exe -v <filename> - This causes HTML Validator to validate the file specified by filename. -v forces the HTML Validator to open the results with the viewer, regardless of the options set in the Classic Page in the Validator Engine Options. The -rx option can be used with this command to return the number of error messages or error+warning messages (see below). NOTE: Use the -o option to open a file in the integrated editor.
•cmdlineprocessor.exe -o <filename> - This causes HTML Validator to open the file specified by filename in the integrated editor. Filenames may be enclosed by quotation marks and should be if the filename contains space characters.
•cmdlineprocessor.exe -q - If HTML Validator's editor is running, then this command sends a quit signal that causes it to exit. NOTE: Unsaved changes to documents, the configuration file, and the Batch Wizard target list will be lost if HTML Validator is closed in this manner. If the Batch Wizard is processing a target list, then HTML Validator will attempt to exit after the processing is completed and the job is done. cmdlineprocessor.exe will return (exit) and the command will complete when HTML Validator's editor exits and is no longer running in the system. If no instance of the editor is found, then this command will wait up to 10 seconds looking for an instance to send the quit signal to (this solves some possible timing issues).
•cmdlineprocessor.exe -w <URL> - This causes HTML Validator to open the URL specified by <URL> in the integrated editor using 'Open from the Web'. If the URL does not start with "http://" or "https://" then "https://" is automatically prepended.
NOTE: The program options and configuration used to validate a document using a command line are those that are last saved and not necessarily those that are currently active if an instance of HTML Validator is running. This includes validating a document using an HTML editor that provides integrated support for HTML Validator. If you've made changes to the options or configuration, then make sure that these changes have been saved before calling the validator on a command line.
IMPORTANT: Specify these options before the primary command (before any -b, -f, -q, etc).
The -outputfile <filename> option can be used to specify the output file, overriding the default. Use this option only when doing a validation (but not with a Batch Wizard command). |
( •-x0 - Do not generate an XML output file •-x1 - Generate an XML output file NOTE: Do not use -x by itself (without a number) as this command is reserved for a special purpose. |
The -veofile <filename> option can be used to specify a validator engine options export file (VEO file) that is loaded before the main command. This allows commands to be performed using different sets of validator options. NOTE: This option can now be used with -b, -q, or by itself. When used in one of these ways, it causes the validator engine options to be changed for all future validations. It works as if a user opened the editor then went to the Validator Engine Options, imported a VEO file and then saved the options. |
The -v0 option can be used to suppress the viewer. Use this option only when doing a validation (but not with a Batch Wizard command). |
The preferred way to open a file in the editor is to use cmdlineprocessor.exe with the -o option. Another method would be to call chv230.exe followed by the filename. For example, chv230.exe <filename>. |
When cmdlineprocessor.exe exits, it returns one of the following exit codes: •0 - no errors occurred in the cmdlineprocessor.exe portion of the command; however, it is possible an error occurred later •1 - a filename was given on the command line but the file does not exist •2 - miscellaneous error •3 - a filename is required for the command but none was given •4 - a timeout occurred waiting for HTML Validator's message window to become available; message could not be sent The -rx option, where x is a number, can be used to change the exit code so that it is based on the number of errors and warnings found in a document. This allows you to take different actions based on the results of a validation. Use this option only when doing a validation (but not with a Batch Wizard command). To use this option, make sure that it is used before the main command option. For example, to return the number of errors in test.html, use cmdlineprocessor.exe -r1 test.html or cmdlineprocessor.exe -r1 -v test.html. The following -rx options are allowed: •-r0 - normal behavior (returns the default/normal exit code) •-r1 - return the number of validator error messages •-r2 - return the number of validator error messages plus the number of warning messages NOTE: If the default exit codes are overridden with -rx and an error occurs, then the negative of the default exit code will be returned. For example, if -r1 or -r2 is used and a bad filename is given, then -1 will be returned. NOTE: If the exit code would be 259 (STILL_ACTIVE) then the exit code is automatically reduced by 1 to 258. This is to prevent problems with applications that test the exit code for STILL_ACTIVE. This prevents the application from thinking that cmdlineprocessor.exe is still active when it really isn't, and from possibly getting into an infinite loop. |