PowerShell Genie

Start-Process

Use Start-Process to launch an executable or open a file with its associated program.

Command 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — Start-Process

Syntax

1PS> Start-Process [-FilePath] <String> [[-ArgumentList] <string[]>] [-Credential <PSCredential>] [-WorkingDirectory <String>] [-Wait] [-PassThru] [-Verb <String>] [-WindowStyle <ProcessWindowStyle>] [<CommonParameters>]
See the command anatomy

Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

Start-Process [-FilePath] <String> [[-ArgumentList] <string[]>] [-Credential <PSCredential>] [-WorkingDirectory <String>] [-Wait] [-PassThru] [-Verb <String>] [-WindowStyle <ProcessWindowStyle>] [<CommonParameters>]
  1. Stage 1Start-Process-FilePath -ArgumentList -Credential -WorkingDirectory -Wait -PassThru -Verb -WindowStyle

    Try it

    Windows PowerShell

    PowerShell example · browser support is limited.

    Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.

    Interactive simulation · fictional data

    Examples

    Start-Process -FilePath notepad.exe

    1PS> Start-Process -FilePath notepad.exe -PassThru | Select-Object Id, ProcessName
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Handles  NPM(K)  PM(M)  WS(M)  CPU(s)   Id  ProcessName
    -------  ------  -----  -----  ------   --  -----------
    86       12      18.4   27.2   0.08     7344 notepad

    Start-Process -FilePath powershell.exe

    1PS> Start-Process -FilePath powershell.exe -Verb RunAs -ArgumentList "-File C:\Scripts\Backup-Files.ps1"
    Show reference output

    Sample output · fictional data, shaped like the real thing

    (No pipeline output. The process was started in the sample environment.)

    Start-Process -ArgumentList

    1PS> Start-Process robocopy.exe -ArgumentList @("C:\src","D:\dst","/E") -Wait -WindowStyle Hidden
    Show reference output

    Sample output · fictional data, shaped like the real thing

    (No pipeline output. The process was started in the sample environment.)

    Parameters

    Parameter definitions:

    • -FilePath
    • -ArgumentList
    • -Credential
    • -WorkingDirectory
    • -Wait
    • -PassThru
    • -Verb
    • -WindowStyle

    Start-Process on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Start-Process when you need to launch an executable or open a file with its associated program. Review syntax and sample output, then try an example in the browser lab. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.

    Common error and fix: A file-not-found error needs checking the executable path separately from its arguments. Use an absolute -FilePath, quote arguments correctly and set the working directory deliberately. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.

    See also: Stop-Process. Start-Process launches an executable; Stop-Process terminates a running process. Launching is separate from waiting for completion and checking the child process exit code. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Start-Process reference on Microsoft Learn

    Recap

    Start-Process Use Start-Process to launch an executable or open a file with its associated program.

    Next: Get-Process
    Genie guideStart-Process

    Use Start-Process to launch an executable or open a file with its associated program. The console below is pre-loaded — run it, then change a value and run it again.