Windows Service Check name start by space

Hello Forum,

I got a little tricky thing here, for no reason at all I have services in Windows start by a space, exemple : " PHone weird system", I was able to connect the up.time agent in the system, check other services, but those with a space at the begging I'm simply stuck, I tried to escape the character with / and \, I tried to put " ", ' ' but it doesn't work.

Basically I saw the check result is omitting the space, so I guess the check not find the Windows service.

Any help ?

Thanks in advance

No Data
  • Ok i found a solution pretty lame but whom works.
    I created a custom script to be able to check the service starting by a space in his name.
    in batch:
    sc query " PHone weird system" | find "RUNNING"
    in PowerShell:
    $statusService = (Get-Service -Name " PHone weird system").Status

    I say lame, because it's an convoluted path. Plus, I usually use PowerShell, and Uptime is not able to manage it, so I have to create a .bat to launch the .ps1, so another extension to my path.

    Other thoughts ?

No Data