
Table of contents
- Introduction to PowerShell’s Start-Process Command
- Understanding the Start-Process Command
- Running Programs with PowerShell’s Start-Process Command
- Running Programs with Elevated Privileges using Start-Process Command
- Running executables as a different user with Start-Process in PowerShell
- Running PowerShell Scripts with Start-Process Command
- Using Arguments with Start-Process Command
- Running Executables with Start-Process Command
- Running Batch Files with Start-Process Command
- Common Errors and Troubleshooting Tips with Start-Process Command
- Conclusion and Best Practices
Introduction to PowerShell’s Start-Process Command
The PowerShell Start-Process command is a powerful tool that is used to start a new program or script in a new process. This cmdlet lets us launch external programs directly from the command line or a PowerShell script. You can use it to start any program, including batch files, executables, and PowerShell scripts.
Understanding the Start-Process Command

The PowerShell Start-Process command has a number of different parameters that you can use to customize the way that the command runs. The most important parameter is the FilePath parameter, which specifies the location of the program or script that you want to start.
Another important parameter is the ArgumentList parameter, which allows you to pass arguments to the program or script you are starting. For example, if you are starting a PowerShell script, you can pass in parameters to the script using the ArgumentList parameter.
The Start-Process command also has parameters that let you specify the working directory, window style, and priority of the process you’re starting. These parameters can be useful if you need to start a program or script in a specific way. Along with other default parameters, Here is the list of important parameters of start-process cmdlet:
| Parameter | Description |
|---|---|
| -FilePath | Specify the executable, application, file, batch, or script to run |
| -ArgumentList | Specifies parameters to use with the process to start |
| -Credential | User account to run the process |
| -NoNewWindow | Open a window in the current console process |
| -Passthru | Returns the process object of the process started. You can get the process ID from it. |
| -RedirectStandardError | Specify text file to redirect error output to |
| -RedirectStandardInput | Text file with input for the process |
| -RedirectStandardOutput | Specify text file to redirect output to |
| -UseNewEnvironment | The process will use new environment variables specified for the process instead default, under: Machine and user |
| -WindowStyle | Specifies the state of the window: Normal, Hidden, Minimized, or Maximized |
| -LoadUserProfile | Loads the Windows user profile from the HKEY_USERS registry key for the current user. This does not affect the PowerShell profiles. |
| -Wait | Wait for the process to complete before continuing with the script |
| -WorkingDirectory | The location where the process should start in |
| CommonParameters | Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable |
Running Programs with PowerShell’s Start-Process Command
Start-Process -FilePath "notepad.exe"
This command would start Notepad in a new process.

If you want to run an executable in the background without displaying any windows or prompts, you can use the -WindowStyle Hidden parameter of the Start-Process cmdlet. Similarly, you can open any specified file (Non-executable file, such as a doc file) in a new window using:
Start-Process -FilePath "C:\Docs\AppLog.txt" -WindowStyle Maximized
This opens the file “C:\Docs\AppLog.txt” in a maximized window.
PowerShell to Open Files
To open a file in PowerShell, you can use the Start-process (or its alias: Start) command:
Start "C:\Temp\Archive.zip"
This method allows you to open files in the associated programs in PowerShell. In the above case, the zip file will be opened in WinRAR/WinZip/Windows Explorer, depending on your computer’s default program associations.
Open File Explorer from PowerShell
To open Windows File Explorer from PowerShell, Use: Start-Process Explorer
Running Programs with Elevated Privileges using Start-Process Command
Start-Process -FilePath "powershell.exe" -Verb RunAs
Start-Process -FilePath "C:\Temp\Log.txt" -Verb Print
Running executables as a different user with Start-Process in PowerShell
Start-Process -FilePath "powershell.exe" -Credential (Get-Credential)

# Parameters $FilePath = "C:\Scripts\RunMe.bat" $UserName = "Crescent\salaudeen" $Password = "Password goes here" #Prepare the Credentials $SecurePassword = ConvertTo-SecureString $Password -AsPlainText -Force $Credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword #Start a process with Start-Process -FilePath $FilePath -Wait -Credential $Credential
Running PowerShell Scripts with Start-Process Command
The PowerShell Start-Process command can also be used to start PowerShell scripts. To start a PowerShell script, you need to specify the location of the script using the FilePath parameter. Additionally, you can pass arguments to the script using the ArgumentList parameter.
Start-Process -FilePath "powershell.exe" -ArgumentList "-File C:\Scripts\MyScript.ps1"
This command would start the MyScript.ps1 script in a new PowerShell process.
Using Arguments with Start-Process Command
As mentioned earlier, the PowerShell Start-Process command allows you to pass arguments to the program or script you are starting. This can be useful if you need to customize the behavior of the program or script.
For example, if you are starting a program that requires command-line arguments, you can pass those arguments using the ArgumentList parameter.
Start-Process -FilePath "myprogram.exe" -ArgumentList "-arg1 value1", "-arg2 value2"
This command would start the myprogram.exe program with the arguments “-arg1 value1” and “-arg2 value2”. The parameter values depend on the application you are running. Let’s take an example: Suppose you want to open a URL in Google Chrome. Here’s how you can do it:
Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList "https://www.google.com" -Wait -WindowStyle Maximized

In this example, the -FilePath parameter specifies the path to the executable file for Chrome and the -ArgumentList parameter provides the URL to open in Chrome. The arguments are passed as a string, where a space separates each argument. It also uses a wait switch to wait for the process to close and Windowstyle parameters. This enables us to provide multiple args to the executable and customize its behavior.
Running Executables with Start-Process Command
Running executables with Start-Process in PowerShell is a straightforward process. By simply specifying the path of the executable as an argument to the Start-Process cmdlet, PowerShell launches the program and executes it. This method is particularly useful when you want to run standalone executables without any additional parameters or customization. Let’s take a look at an example:
To start an executable, you need to specify the location of the executable using the FilePath parameter.
Start-Process -FilePath "C:\MyProgram\MyProgram.exe"
This command would start the MyProgram.exe executable.
Running Batch Files with Start-Process Command
PowerShell is not limited to running standalone executables only; it can also execute scripts and batch files effortlessly. By utilizing the Start-Process cmdlet, we can launch scripts and batch files in PowerShell and automate complex tasks. This provides us with the flexibility to integrate PowerShell with other scripting languages and leverage their capabilities. Let’s take a look at an example of running a PowerShell script using Start-Process:
To start a batch file, you need to specify the location of the batch file using the FilePath parameter.
Start-Process -FilePath "C:\MyBatchFile.bat"
Common Errors and Troubleshooting Tips with Start-Process Command
While the PowerShell Start-Process command is a powerful tool, there are a few common errors that you may encounter.
- Access is denied: One common error is the “Access is denied” error. This error occurs when you try to run a program or script with elevated privileges, but you do not have permission to do so. To fix this error, you will need to log in as an administrator or use the RunAs parameter to run the program with elevated privileges.
- File not found: Another common error is the “File not found” error. This error occurs when you specify an incorrect file path. To fix this error, you will need to double-check the file path and make sure that it is correct. This includes verifying file permissions and network access if the executable resides on a remote machine. Always use the full path of the executable to avoid any ambiguity or reliance on the system’s PATH environment variable.
- Invalid Arguments: If the executable requires specific arguments, ensure that they are passed correctly using the
ArgumentListparameter of theStart-Processcmdlet.
Conclusion and Best Practices
When using the Start-Process command, it is important to double-check your file paths and arguments to avoid common errors. Additionally, it is a good practice to test your commands in a test environment before running them in a production environment.
Now that you have a better understanding of the PowerShell Start-Process command, you can start using it to automate your tasks and streamline your workflow!
How do I run a PowerShell script like an EXE?
How do I run an EXE file in PowerShell?
To run an EXE file in PowerShell, you can use the “Start-Process” cmdlet. Here’s an example of the command you can use: “Start-Process -FilePath 'C:\Path\to\file.exe'“. Replace ‘C:\Path\to\file.exe‘ with the actual path to your EXE file.
How do I install an EXE file in PowerShell silently?
To install an EXE file silently using PowerShell, you can use the Start-Process cmdlet with the -ArgumentList parameter. Here’s an example of the command you can use: Start-Process -FilePath "path\to\file.exe" -ArgumentList "/silent"
How do I open an application in PowerShell?
How to run an exe file from the command line?
To run an EXE file from the command line, you need to navigate to the directory where the file is located using the “cd” command. Once you are in the current directory, you can simply type the name of an executable file and press enter to run it.
How do I run PS from the command prompt?
How can I wait for a process to finish before proceeding?
To make PowerShell wait for a process to finish before continuing, you can use the -Wait parameter with Start-Process. This parameter ensures that PowerShell waits for the process and all its descendants to exit before returning control.
Can I pass arguments to the executable with Start-Process?
Yes, you can pass arguments to the executable using the -ArgumentList parameter. Start-Process -FilePath "notepad.exe" -ArgumentList "C:\Temp\Logs.txt"
Can I capture the output of a process started with Start-Process?
Yes, you can capture the output of a process by using the -RedirectStandardOutput parameter and specifying a file path to store the output. For example:Start-Process -FilePath "ping.exe" -ArgumentList "google.com" -RedirectStandardOutput "output.txt"
This command will start the ping command, ping google.com, and redirect the output to the “output.txt” file.
Can I start a process in a minimized or maximized window?
Yes, you can control the window state of the process using the -WindowStyle parameter. The available options are “Normal”, “Hidden”, “Minimized”, and “Maximized”. For example: Start-Process -FilePath "notepad.exe" -WindowStyle Minimized
What you’ll learn
Fundamentals of PowerShell Scripting: Grasping the basics of PowerShell’s command-line interface, cmdlets, syntax, and scripting environment.
Script Writing and Execution: Skills to write, test, and execute PowerShell scripts effectively, starting from simple scripts to more complex ones.
Effective Use of Cmdlets: Understanding and utilizing built-in cmdlets, such as Get-Command and Get-Help, to perform various tasks and retrieve information.
Using Windows Management Instrumentation (WMI): Learning how to use WMI in PowerShell scripts for comprehensive system management and information gathering.
Building and Managing Windows Server 2022: Step-by-step guidance on setting up, configuring, and managing a Windows Server 2022 environment, including installat
Hands-On Lab Assignments: Applying learned concepts in practical scenarios through lab assignments, reinforcing theoretical knowledge with practical application
Dive into the world of automation and efficient system management with our flagship course, ‘Mastering PowerShell: From Basics to Brilliance with Real-World Script Examples’. This course is crafted for individuals at all levels, from beginners to intermediate enthusiasts, and is designed to elevate your scripting capabilities in the practical realms of PowerShell.
Section 1: Scripting Basics and First Steps
Lesson 1: Kicking off with Script Example 1
Explore the course’s structure, aims, and your journey in PowerShell scripting.
Delve into your first script, understanding basic comments and cmdlets.
Learn essential commands like Get-Command and Get-Help.
Engage in hands-on labs with assignments and detailed solutions, solidifying your learning.
Section 2: Advanced Scripting Techniques
Lesson 2: Deep Dive with Script Example 2
Introduction to more complex scripting concepts.
Detailed exploration of using WMI (Windows Management Instrumentation) and Invoke-Command in scripts.
Master the art of using pipelines effectively in scripts.
Section 3: Building a Windows Server 2022 Lab
A practical approach to setting up and managing a Windows Server 2022 environment.
Step-by-step guidance on installing, activating, and performing post-install tasks.
Learn to set up a Base Image with SYSPREP and a Domain Controller.
Section 4: Supplementary Course Content
Additional resources, tips, and advanced tools for enhancing your PowerShell expertise.
Throughout the course, you’ll benefit from our engaging teaching methodology that combines theoretical knowledge with practical applications. Each lesson is accompanied by real-world script examples, making learning both engaging and relevant.
Whether your goal is to streamline your workflows, manage servers more effectively, or simply elevate your scripting skills, ‘Mastering PowerShell: From Basics to Brilliance with Real-World Script Examples’ offers you a comprehensive learning experience. Enroll now and start your journey towards becoming a PowerShell scripting expert.
Who this course is for
- IT Professionals and System Administrators: Those working in IT or system administration who want to enhance their skills in automation, scripting, and efficient system management using PowerShell.
- Aspiring IT Specialists: Individuals aiming to start a career in IT or system administration and looking to acquire essential scripting skills.
- Anyone Looking to Automate Repetitive Windows Tasks: Users who perform repetitive tasks on Windows and seek to automate these tasks to increase productivity and efficiency.
- Software Developers: Developers who want to expand their toolset with scripting skills, particularly for automating tasks in Windows environments.
IT Transformation: Empowering Tech Experts

Vitalii Shumylo is an experienced online tutor with over 20 years of experience in the field of technology and computer science. His expertise ranges from Microsoft technologies, Azure, Red Hat Enterprise Linux, Ubuntu, SuSe, and MacOS, to a wide variety of other software and operating systems.
He has helped countless students become more effective in the pursuit of their professional goals. Vitalii is highly dedicated to providing the highest quality of support to as many individuals as he can. He is passionate about creating educational opportunities that will help people achieve success in their fields of study. With his help, you can gain the skills and knowledge you need to achieve your goals and become a tech expert.



