6

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.

JDavila
  • 339
  • 1
  • 5
  • 21

5 Answers5

16

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.

Tom
  • 15,514
  • 17
  • 42
  • 51
alroc
  • 26,843
  • 6
  • 49
  • 94
  • 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 Nov 11 '16 at 18:41
  • 1
    @JDavila that depends on what those "results" are, what the app is, and how the output is generated. You should open a new question. – alroc Nov 11 '16 at 19:50
  • Well, am trying to display results from a log, specifically, certain columns CSV format. – JDavila Nov 11 '16 at 22:11
  • You're not making it any clearer. Post a new question for this. – alroc Nov 12 '16 at 12:19
12
Start-Process -FilePath "path.exe"
Derlin
  • 9,003
  • 2
  • 25
  • 47
contrashadow
  • 161
  • 1
  • 5
7

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

5

Start-Process is the commandlet you are looking for.

Derlin
  • 9,003
  • 2
  • 25
  • 47
4c74356b41
  • 64,730
  • 6
  • 79
  • 125
-1

Welcome to 2022! The most simplest method is as below :-

1. Open powershell as Administrator

![enter image description here ><

2. See all the App-IDs via this command

StartApps

3. Note the AppID of app you want to open

![enter image description here

in our case we have to open VoiceRecoder soo.. note it baby

4. Finally, open Notepad via AppId

explorer shell:appsFolder\Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe!App

AppIds are almost same for each systems

I hope you see the answer, because it's been 5 years you asked this question.

athrvvv
  • 9
  • 1
  • 3