开发者

how to run .exe file using powershell?

how do i run a .exe file by writing a line in powershell if my .exe file is located in "C:\Program Files\Rainmeter" and the name of the file is Rainmeter.exe ?

im just trying to make a script sry 开发者_StackOverflow社区if this question is dumb

i have already tried these lines

 C:

13:18:42 ❯ cd C:\Program Files\Rainmeter>.\Rainmeter.exe Set-Location: A positional parameter cannot be found that accepts argument 'Files\Rainmeter>.\Rainmeter.exe'.

 C:

13:18:58 ❯ cd C:\Program Files\Rainmeter.\Rainmeter.exe Set-Location: A positional parameter cannot be found that accepts argument 'Files\Rainmeter.\Rainmeter.exe'.

 C:

13:19:14 ❯ cd C:\Program Files\Rainmeter.\Rainmeter.exe Set-Location: A positional parameter cannot be found that accepts argument 'Files\Rainmeter.\Rainmeter.exe'.

 C:

13:04:43 ❯ c:\Program Files\Rainmeter>.\Rainmeter.exe c:\Program: The term 'c:\Program' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

 C:

13:07:09 ❯ cd C:\Program Files\Rainmeter\Rainmeter.exe Set-Location: A positional parameter cannot be found that accepts argument 'Files\Rainmeter\Rainmeter.exe'.


To run an .exe file located in the "C:\Program Files\Rainmeter" directory using PowerShell, you can use the Start-Process cmdlet and specify the path to the .exe file as the value of the -FilePath parameter. Here is an example of how you could use the Start-Process cmdlet to run the Rainmeter.exe file:

Start-Process -FilePath "C:\Program Files\Rainmeter\Rainmeter.exe" Alternatively, you can navigate to the "C:\Program Files\Rainmeter" directory using the cd command and then run the Rainmeter.exe file directly without specifying the full path:

cd "C:\Program Files\Rainmeter" .\Rainmeter.exe

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜