Here are neat examples of how Start-Process can be used to launch executables and other files.
Topics for PowerShell Start-Process Cmdlet
- Example 1: Launch a Program Such as Notepad
- Example 2: Launch Internet Explorer
- Help with Start-Process
- Invoke-Item An Alternative to Start-Process
- Summary of PowerShell Get-Process
Let us begin by executing a built-in Windows program such as Notepad. Start-Process requires V 2.0 or later, I used the PowerShell_ISE (GUI) in Windows 8, but the commands work just as well in plain PowerShell (command-line) in Windows 7.
# PowerShell Launch Notepad
Note 1: The program in this example is in the system’s path, namely
The problem in the second example is that the executable, iexplore, is not in the path. Fortunately, the solution is straightforward, namely define the path to the program files.
# PowerShell Launch Internet Explorer
$Browser = "C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE"
$Browser64 = "C:\Program Files\Internet Explorer\iexplore.exe"
Note 2: In 64-bit operating systems there are two versions of Internet Explorer.
Note 3: Check your path with this PowerShell variable
SolarWinds’ Network Performance Monitor will help you discover what’s happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
PowerShell’s own Get-Help command reveals interesting parameters that can refine the process, for example start Maximized.
# Help for PowerShell’s Start-Process
Note 4: The parameter -WindowStyle allows you to maximize or minimize the application. Whereas, -WorkingDirectory is an alternative to specifiying the full path. I discovered that -FilePath is only useful for examples where you call for document type and need the underlying program.
# PowerShell Start-Process Research
$Path = "C:\Program Files\Internet Explorer"
Start-Process -WorkingDirectory $Path iexplore.exe -WindowStyle Maximized
Both Invoke-Item and Start-Process emulate the ond trick of WinKey +r –> ‘name of executable’.
# Here is an alternative to PowerShell’s Start-Process.
Invoke-Item "C:\Program Files\Internet Explorer\iexplore.exe"
Note 5: Once again, I find that we need to specify the full path to the Internet Explorer.
This is most useful for parameter for modifying the behavior of the underling program you wish to execute.
This Engineer’s Toolset v10 provides a comprehensive console of 50 utilities for troubleshooting computer problems. Guy says it helps me monitor what’s occurring on the network, and each tool teaches me more about how the underlying system operates.
There are so many good gadgets; it’s like having free rein of a sweetshop. Thankfully the utilities are displayed logically: monitoring, network discovery, diagnostic, and Cisco tools. Try the SolarWinds Engineer’s Toolset now!
List More Members of the Process Family
With a noun such as -Process you may suspect that there other members of this family such as Get-Process and Stop-Process, this is how you can find the full list:
# Research PowerShell nouns
Get-Command -noun process
I am not a great fan of PowerShell aliases, however it’s worth knowing that Start is an alias for Start-Process. Incidentally, there is a lesser known alias SAPS.
Start-Process provides a sound way to launch executables from a script, or from the PowerShell interface.
If you like this page then please share it with your friends
See more PowerShell examples of process and service
Please email me if you have a better example script. Also please report any factual mistakes, grammatical errors or broken links, I will be happy to correct the fault.