I try to create a service using PowerShell with following command in PowerShell script (.ps1
):
c:\windows\system32\sc.exe create "blaService" displayname= "blaService" binpath= "\"C:\Program Files\xxxx\xxx xxx\xxxxx\xxxxxx.exe\"" start= "auto"
Then I go to the Registry Editor and I see in the ImagePath field (corresponding to the service I've created):
The result I'd expect to get is the same but quoted, so basically "C:\Program Files\xxxx\xxx xxx\xxxxx\xxxxxx.exe"
I followed this thread: When creating a service with sc.exe how to pass in context parameters?
All comments guide to do the same as I did, so I don't understand where am I wrong