Skip to main content

Unquoted Service Paths - Detection

Description​

Finds the Windows services whose executable path contains a space and is not enclosed in quotation marks, and records them in cPVAL Unquoted Service Paths. It does not change any service. It is the condition of the Unquoted Service Paths - Workstations and Unquoted Service Paths - Servers compound conditions. When it exits with 1, the compound condition runs Unquoted Service Paths - Autofix.

cPVAL Unquoted Service Path Mode decides what happens on each device type: skip, audit or fix. Servers include domain controllers.

A service is reported when the executable part of its path, the text up to the first .exe, contains a space and is not in quotation marks. Spaces in the arguments after the executable are ignored, so C:\Apps\agent.exe -config C:\Program Files\agent.ini is not reported. Kernel drivers are not checked, because Windows loads them without the path search that makes unquoted paths a risk.

The automation verifies its own ProVal signature before it checks anything.

Exit Code 0: No Action Needed​

  • cPVAL Unquoted Service Path Mode is Disabled or blank, or skips this device type. cPVAL Unquoted Service Paths is not changed.
  • No service has an unquoted path. cPVAL Unquoted Service Paths is cleared.
  • Services were found and the mode only audits this device type. They are recorded in cPVAL Unquoted Service Paths with AutofixAttempted set to 0.

Exit Code 1: Unquoted Service Paths - Autofix Must Run​

Services were found and the mode fixes this device type. They are recorded in cPVAL Unquoted Service Paths with AutofixAttempted set to 0, and the output contains a line that begins with Detected: and lists the services.

Exit Code 2: Script Failure​

The output gives the reason. Unquoted Service Paths - Autofix does not run.

Requirements​

  • Windows PowerShell 5.1, run as System.
  • Access to contentrepo.net, for the signature check.

Sample Run​

Manual execution of this script is not recommended. It is designed to run as the condition of the solution's compound conditions.

Dependencies​

Custom Fields​

Field LabelScopeAccepted ValuesDefault ValueDescription
cPVAL Unquoted Service Path ModeSystem, Organization, Location, DeviceDisabled, Audit All, Audit Workstations Only, Audit Servers Only, Autofix All, Autofix Workstations Only, Autofix Servers Only, Autofix Workstations and Audit Servers, Autofix Servers and Audit WorkstationsBlank, which works like DisabledDecides whether this device type is skipped, audited or fixed.
cPVAL Unquoted Service PathsDeviceWritten by the automation-The services with an unquoted path. Cleared when none is found.

Automation Setup/Import​

Automation Configuration

Output​

Changelog​

2026-10-27​

  • Initial version of the document