Executing an EXE file using a PowerShell script

前端 未结 5 1932
粉色の甜心
粉色の甜心 2020-11-29 20:30

I\'m trying to execute an EXE file using a PowerShell script. If I use the command line it works without a problem (first I supply the name of the executable and series of p

5条回答
  •  北海茫月
    2020-11-29 21:27

    Not being a developer I found a solution in running multiple ps commands in one line. E.g:

    powershell "& 'c:\path with spaces\to\executable.exe' -arguments ; second command ; etc
    

    By placing a " (double quote) before the & (ampersand) it executes the executable. In none of the examples I have found this was mentioned. Without the double quotes the ps prompt opens and waits for input.

提交回复
热议问题