Run Visual Expert from the Command Line
The Visual Expert command-line tool runs Visual Expert tasks without opening the interface. You can call it from a batch script or a scheduled task.
Use it to:
- analyze a project,
- generate HTML documentation of your code,
- export code review reports in JUnit, JSON or XML format,
- list your Visual Expert projects,
- install or uninstall the scheduler service.
The tool works on existing projects. Create and configure your project in Visual Expert first.
1. Open a command prompt in the Visual Expert folder
The command-line tool, Novalys.VisualExpert.Console.CommandLine.exe, is located in the Visual Expert installation folder.
- Open the Windows Start menu, type
cmd, then click Command Prompt. - Go to the Visual Expert installation folder. Adjust the folder name to your Visual Expert version:
cd "C:\Program Files\Novalys\Visual Expert 2026"
In the examples below, replace My Project with the name of your project. Keep the quotation marks around names and paths that contain spaces.
2. Command-line options
| Short | Long option | Purpose |
|---|---|---|
-p | --project | Specifies the project name. |
-a | --Analysis | Starts a new analysis of the project. |
-d | --Documentation | Generates the documentation of the analyzed source code. |
-t | --DocumentationType | Selects the documentation type: reference or codereview. |
-O | --ReportOutputPath | Sets the path of the code review report file. |
-R | --ReportType | Selects the report type: CodeRuleBased or DefectSummaryBased. |
-F | --ReportFormat | Selects the report format: JUNIT, JSON or XML, depending on the report type. |
-L | --GetProjectsList | Lists the Visual Expert projects and generates a project list file. |
-I | --InstallService | Installs the scheduler service. |
-U | --UninstallService | Uninstalls the scheduler service. |
-v | --version | Displays the version of the tool. |
--help | Displays the help and usage examples. |
Options are case-sensitive. Type them exactly as shown, including the uppercase -O, -R, -F, -L, -I and -U.
3. Analyze a project
Combine -a with -p to start a new analysis of the project:
Novalys.VisualExpert.Console.CommandLine.exe -a -p "My Project"
The tool displays the progress of each analysis step. The last line confirms the end of the analysis:
Project Name : My Project
[######----] 61% |
------------------------------------------------------------
Title:Source Code successfully recorded
------
Status:Info
Message:The Duration of the operation is: 00:00:00.2368349
...
[##########] 100% |
Analysis completed successfully for the project My Project.
4. Generate HTML documentation of your code
Use -d with the project name, and select the documentation type with -t. If you omit -t, Visual Expert generates the source code documentation.
Both types are HTML documents to read in a web browser. To get a file that other tools can process, see step 5.
Source code documentation (-t reference)
Novalys.VisualExpert.Console.CommandLine.exe -d -p "My Project" -t reference
Code review documentation (-t codereview)
Novalys.VisualExpert.Console.CommandLine.exe -d -p "My Project" -t codereview
The last line of the output gives the path of the generated documentation. Open this index.html file in a web browser:
Project Name : My Project
Documentation Type : codereview
[##########] 100% |
Documentation generated for the project My Project.
C:\ProgramData\Novalys\VEDocs\My Project_2026-10-26_10-21-00\index.html
To change the content and style of the documentation, open your project in Visual Expert, click the Documentation tab, then click Advanced Settings. The Documentation Center opens. In its Settings section, select the template, the style and the content to include. See How to Generate a Source Code Documentation.
5. Export a code review report
Add the report options to the analysis command (see step 3). Visual Expert generates the report at the end of the analysis.
-O: path of the report file.--ReportType: type of report.--ReportFormat: file format.
Always specify both the report type and the format.
| Report type | Formats | Content |
|---|---|---|
CodeRuleBased | JUNIT | Code rule results, in JUnit XML format. |
DefectSummaryBased | JSON or XML | Defect counts by severity, status and type. |
In the examples below, the ^ character at the end of a line means that the command continues on the next line. Paste the example as is into Command Prompt, or type the command on a single line without the ^ characters.
Code rule report in JUnit format
Novalys.VisualExpert.Console.CommandLine.exe -a -p "My Project" ^
-O "C:\temp\code-rules.xml" ^
--ReportType CodeRuleBased --ReportFormat JUNIT
When the analysis ends, the tool confirms the location of the report:
Output file generated at C:\temp\code-rules.xml
Analysis completed successfully for the project My Project.
The success and failure criteria of each code rule come from the Code Review Profile of the project. Select the profile in Visual Expert under Project Settings > Code Inspection.
The report contains:
- one
testsuiteelement per application, with its size and metrics, - one
testcaseelement per code rule, with its number of active issues, severity and type, - a
failureelement when the number of issues exceeds the limit set by the Code Review Profile, - a
urlattribute that opens the defects of the rule in Visual Expert Web.
JUnit XML is a standard format for test results. Most continuous integration servers can read it.
Report excerpt
<testsuites analysisId="15" analysisDate="10/15/2026 3:13:40 PM">
<testsuite name="My Application" size="1853" reliability="28" security="2"
maintainability="1275" comments="6.21 %"
codeReviewProfile="LegacyCode" tests="79" failures="49">
<testcase name="A primary key should be specified during table creation"
coderuleId="VETSQLRULE57" activeIssues="12"
severity="Critical" type="Maintainability"
url="https://your-ve-web-server/codeinspection/1002/15/rules/defects/VETSQLRULE57">
<failure message="Found 12 issues across 1853 lines of code, exceeding the maximum allowed limit of 1 issues for this rule." />
</testcase>
<testcase name="CATCH clauses should do more than rethrow"
coderuleId="VETSQLRULE50" activeIssues="1"
severity="Minor" type="Maintainability"
url="https://your-ve-web-server/codeinspection/1002/15/rules/defects/VETSQLRULE50" />
...
</testsuite>
</testsuites>
Defect summary in JSON format
Novalys.VisualExpert.Console.CommandLine.exe -a -p "My Project" ^
-O "C:\temp\defects.json" ^
--ReportType DefectSummaryBased --ReportFormat JSON
Defect summary in XML format
Novalys.VisualExpert.Console.CommandLine.exe -a -p "My Project" ^
-O "C:\temp\defects.xml" ^
--ReportType DefectSummaryBased --ReportFormat XML
The defect summary contains:
- a summary: lines of code, active defects, critical and major defects, new defects, bugs, vulnerabilities, assigned defects and resolved defects,
- the number of active and new defects by severity,
- the number of defects by status,
- the number of active and new defects by type.
Each count comes with a url that opens the matching defect list in Visual Expert Web, with the filters already applied.
Report excerpt (JSON)
{
"analysisId": 14,
"reportType": "DefectSummaryBased",
"analysisDate": "2026-10-15T15:10:12.9961477",
"projectName": "My Project",
"summary": {
"linesOfCode": 1853,
"activeDefects": {
"count": 506,
"url": "https://your-ve-web-server/codeinspection/1002/14/defects?filter=Active"
},
"criticalAndMajorDefects": {
"count": 130,
"url": "https://your-ve-web-server/codeinspection/1002/14/defects?filter=Active&severity=Critical&severity=Major"
},
...
},
"defectsBySeverity": [
{
"severity": "Critical",
"activeDefects": {
"count": 71,
"url": "https://your-ve-web-server/codeinspection/1002/14/defects?filter=Active&severity=Critical"
},
...
},
...
],
"defectsByStatus": [ ... ],
"defectsByType": [ ... ]
}
6. List your Visual Expert projects
Novalys.VisualExpert.Console.CommandLine.exe -L
This command displays the name of each project, to use with the -p option. It also generates a file that contains this list.
Total 12 projects found
SQL Server Sample project
Oracle Sample project
PB+Oracle Sample project
PB+SQL Server Sample project
PB Sample project
...
Project list file successfully generated
7. Install or uninstall the scheduler service
The scheduler service (VisualExpertScheduling) runs the tasks scheduled in Visual Expert, such as the scheduled generation of documentation.
These commands require administrator rights. Open the Windows Start menu, type cmd, right-click Command Prompt, then click Run as administrator. Then go to the Visual Expert installation folder (see step 1).
Install the scheduler service
Novalys.VisualExpert.Console.CommandLine.exe -I
VisualExpertScheduling service install successfully.
Uninstall the scheduler service
Novalys.VisualExpert.Console.CommandLine.exe -U
VisualExpertScheduling service uninstall successfully.
8. Display the help or the version
List all options with usage examples
Novalys.VisualExpert.Console.CommandLine.exe --help
Display the version of the tool
Novalys.VisualExpert.Console.CommandLine.exe -v
2026.10.26.1021