Is there a command that exists that will open any application from PowerShell?
When typing in "notepad", this will open Microsoft Notepad. However, other applications do not seem to open this way.
The next method to run .exe files in PowerShell is by using the Start-Process cmdlet. This cmdlet starts one or more processes on your local device. This will run the executable file.
Running a PowerShell script from the Command Prompt If you would like to run a PowerShell script in CMD, you'll need to execute it by calling the PowerShell process with the -File parameter, as shown below: PowerShell -File C:\TEMP\MyNotepadScript. ps1. PowerShell -File C:\TEMP\MyNotepadScript.
Notepad runs in this way not because of any Powershell magic, but because notepad.exe
exists in one of the directories specified in your $env:PATH
environment variable. The system behaves the same as when using cmd.exe
(Command Prompt) in this regard.
You can start any application by specifying the full path to its executable: C:\Program Files\FileZilla FTP Client\filezilla.exe
. You can optionally use Start-Process
with the EXE if you want to capture a reference to the executable to gain more control over it from Powershell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With