17

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.

1

6 Answers 6

20

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks @alroc, this works great, though is there something I could use to pipe the results? This might require another question to be posted.
@JDavila that depends on what those "results" are, what the app is, and how the output is generated. You should open a new question.
Well, am trying to display results from a log, specifically, certain columns CSV format.
You're not making it any clearer. Post a new question for this.
18
Start-Process -FilePath "path.exe"

Comments

10

I know this is an old thread, but if you are trying to open a file you can do it like this

& .\filename.ext

It will use the standard program to open the file

2 Comments

This is using Windows cmd shell. Prepend this with start this works!
Thank you! This is the proper answer, and works great.
6

Start-Process is the commandlet you are looking for.

Comments

6

The simplest method that I know of is using the AppId of the application:

  1. Open powershell as Administrator

    enter image description here

  2. See all the App-IDs via this command

    Get-StartApps
    
  3. Note the AppID of app you want to open

    enter image description here

    in our case we have to open VoiceRecoder

  4. Finally, open Voice Recorder via AppId

    explorer shell:appsFolder\Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe!App
    

AppIds are mostly the same between systems

1 Comment

For me it was Start-Process shell:AppsFolder\<app-id>.
-1

This same PowerShell script can be put in a shortcut. I right-clicked on an empty spot on my desktop and then clicked New => Shortcut and pasted:
explorer shell:appsFolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
and named the shortcut "Clock" Now I can start the Clock app with the shortcut. No need for Powershell or pinning another icon on my Taskbar.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.