TestimoX

API Reference

Class

ServiceImagePathParser

Namespace ComputerX.Registry
Assembly ComputerX
Modifiers static

Helpers for parsing Windows service ImagePath command lines stored in the registry. Splits the raw value into an executable path and the remaining arguments, with optional environment-variable expansion. The logic is tolerant of quoted and unquoted forms.

Inheritance

  • Object
  • ServiceImagePathParser

Methods

public static ValueTuple<String, String> Split(String imagePath, Boolean expandEnv = true) #
Returns: ValueTuple<String, String>

Split a service ImagePath string into executable path and arguments.

Parameters

imagePath System.String requiredposition: 0
Raw registry value from HKLM\SYSTEM\CurrentControlSet\Services\<Name>\ImagePath.
expandEnv System.Boolean = true optionalposition: 1
When true, expands environment variables (e.g., %SystemRoot%) in both parts.

Returns

Tuple where exePath is the resolved executable (may be null when input is null/empty) and args is the remaining command line (may be null/empty).