PowerShell Logo Small

Start-Process



This is the built-in help made by Microsoft for the command 'Start-Process', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Starts one or more processes on the local computer.

SYNTAX


Start-Process [-FilePath] <String> [[-ArgumentList] [<String[]>]] [-Credential [<PSCredential>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore |
Suspend}] [-InformationVariable [<System.String]>]] [-LoadUserProfile] [-NoNewWindow] [-PassThru] [-RedirectStandardError [<String>]] [-RedirectStandardInput [<String>]]
[-RedirectStandardOutput [<String>]] [-UseNewEnvironment] [-Wait] [-WindowStyle {Normal | Hidden | Minimized | Maximized}] [-WorkingDirectory [<String>]] [<CommonParameters>]
Start-Process [-FilePath] <String> [[-ArgumentList] [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}]
[-InformationVariable [<System.String]>]] [-PassThru] [-Verb [<String>]] [-Wait] [-WindowStyle {Normal | Hidden | Minimized | Maximized}] [-WorkingDirectory [<String>]]
[<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


Starts one or more processes on the local computer. To specify the program that runs in the process, enter an executable file or script file, or a file that can be opened
by using a program on the computer. If you specify a non-executable file, Start-Process starts the program that is associated with the file, much like the Invoke-Item cmdlet.


You can use the parameters of Start-Process to specify options, such as loading a user profile, starting the process in a new window, or using alternate credentials.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=293918
Debug-Process
Get-Process
Start-Service
Stop-Process
Wait-Process

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>start-process sort.exe



This command starts a process that uses the Sort.exe file in the current directory. The command uses all of the default values, including the default window style, working
directory, and credentials.










-------------------------- EXAMPLE 2 --------------------------

PS C:\>start-process myfile.txt -workingdirectory "C:\PS-Test" -verb Print



This command starts a process that prints the C:\PS-Test\MyFile.txt file.










-------------------------- EXAMPLE 3 --------------------------

PS C:\>start-process Sort.exe -RedirectStandardInput Testsort.txt -RedirectStandardOutput Sorted.txt -RedirectStandardError SortError.txt -UseNewEnvironment



This command starts a process that sorts items in the Testsort.txt file and returns the sorted items in the Sorted.txt files. Any errors are written to the SortError.txt
file.

The UseNewEnvironment parameter specifies that the process runs with its own environment variables.










-------------------------- EXAMPLE 4 --------------------------

PS C:\>start-process notepad -wait -windowstyle Maximized



This command starts the Notepad process. It maximizes the window and retains the window until the process completes.










-------------------------- EXAMPLE 5 --------------------------

PS C:\>start-process powershell -verb runAs



This command starts Windows PowerShell with the "Run as administrator" option.










-------------------------- EXAMPLE 6 --------------------------

PS C:\>$startExe = new-object System.Diagnostics.ProcessStartInfo -args PowerShell.exe
PS C:\>$startExe.verbs
open
runas

# Starts a PowerShell process in a new console window.

PS C:\>start-process powershell.exe -verb open

# Starts a PowerShell process with "Run as Administrator" permissions.

PS C:\>start-process powershell.exe -verb runas



These commands show how to find the verbs that can be used when starting a process, and the effect of using the verbs to start the process.

The available verbs are determined by the file name extension of the file that runs in the process. To find the verbs for a process, create a
System.Diagnostics.ProcessStartInfo object for the process file and look in the Verbs property of the object. In this example, we'll use the PowerShell.exe file that runs in
the PowerShell process.

The first command uses the New-Object cmdlet to create a System.Diagnostics.ProcessStartInfo object for PowerShell.exe, the file that runs in the PowerShell process. The
command saves the ProcessStartInfo object in the $startExe variable.

The second command displays the values in the Verbs property of the ProcessStartInfo object in the $startExe variable. The results show that you can use the Open and Runas
verbs with PowerShell.exe, or with any process that runs a .exe file.

The third command starts a PowerShell process with the Open verb. The Open verb starts the process in a new console window.

The fourth command starts a PowerShell process with the RunAs verb. The RunAs verb starts the process with permissions of a member of the Administrators group on the
computer. This is the same as starting Windows PowerShell with the "Run as administrator" option.