Skip to content

Check App in PATH

James Small edited this page Mar 29, 2018 · 2 revisions

How to check if your application/executable is accessible (correctly in PATH) - Windows/PowerShell

  • Also - Which executable am I using?
  • Also - Where is my executable located?

Check app/executable accessible from PATH

  • Launch PowerShell
    • Windows-Key + R to open Run Application Box (or Click on the Windows Start menu and then select Run...)
    • Enter: powershell
    • Click OK (or hit enter)
  • Use gcm (alias for Get-Command)
    • For this example, we'll see if the atom text editor was correctly installed (setup in PATH)
    • gcm atom
    • Expected output:
      C:\Users\jsmall> gcm atom
      
      CommandType     Name                                 Version    Source
      -----------     ----                                 -------    ------
      Application     atom.cmd                             0.0.0.0    C:\Users...
      
      
      C:\Users\jsmall> 
      
    • Output if atom not installed correctly/not in PATH:
      C:\Users\jsmall> gcm atom
      gcm : The term 'atom' is not recognized as the name of a cmdlet, function,
      script file, or operable program. Check the spelling of the name, or if a
      path was included, verify that the path is correct and try again.
      At line:1 char:1
      + gcm atom
      + ~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (atom1:String) [Get-Command],
      CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.
      Commands.GetCommandCommand
      
      C:\Users\jsmall> 
      
    • Where is atom installed/which executable am I using?
      C:\Users\jsmall> gcm atom | select Path
      
      Path
      ----
      C:\Users\jsmall\AppData\Local\atom\bin\atom.cmd
      
      
      C:\Users\jsmall> 
      
    • Additional information on atom/PowerShell:
      • gcm atom | fl
      • help gcm
      • help gcm -online
      • help about

It didn't work for you? Well then, please open an issue!

Return to Wiki/FAQ Home Page


Note: Tested on Windows 7