Spaces cause split in path with PowerShell

前端 未结 12 847
广开言路
广开言路 2020-12-02 15:24

I\'m having an issue with powershell when invoking an exe at a path containing spaces.

PS C:\\Windows Services> invoke-expression \"C:\\Windows Services\\My

12条回答
  •  再見小時候
    2020-12-02 15:53

    Try this, simple and without much change:

    invoke-expression "'C:\Windows Services\MyService.exe'"

    using single quotations at the beginning and end of the path.

提交回复
热议问题