PowerShell can run EXE files in several different ways, and the best method depends on whether you need a simple launch, command-line arguments, or more control over the process. If you are automating Windows tasks, testing software, or scripting system actions, knowing these options can save time and prevent common path and quoting errors.
This guide shows five practical ways to run executable files from PowerShell, with examples you can adapt to your own scripts.
1. Run the EXE Directly
The simplest method is to type the executable name or full path at the PowerShell prompt. PowerShell will launch it just like a command when the file is in the current folder or available through the system PATH.
- Run an EXE in the current folder by typing its name, such as .\MyApp.exe.
- Run an EXE elsewhere by entering the full path, such as C:\Tools\MyApp.exe.
- Press Enter to start the program.
2. Use the Call Operator (&)
The call operator is one of the most useful ways to run an EXE from a script. It tells PowerShell to treat the following item as a command, which is especially helpful when the executable path is stored in a variable or contains spaces.
- Store the path in a variable, such as $exe = 'C:\Program Files\MyApp\MyApp.exe'.
- Run it with the call operator: & $exe.
- Add arguments after the path if needed, separated by spaces.
This method is common in scripts because it works cleanly with dynamic paths and is clearer than trying to build a command string manually.
3. Run an EXE with Arguments
Many programs need command-line arguments, such as a file name, switch, or option. In PowerShell, you can pass arguments directly after the executable name, but you need to be careful with spaces and quotes.
- Type the EXE path or use the call operator.
- Add the required switches or file paths after it.
- Put paths with spaces in quotes, such as 'C:\My Files\test.txt'.
Example:
& 'C:\Tools\MyApp.exe' -silent -log 'C:\My Files\app.log'
4. Use Start-Process for More Control
Start-Process is a better option when you want more control over how the EXE opens. It is useful if you want to run a program in the background, wait for it to finish, or pass arguments in a structured way.
- Use Start-Process -FilePath to specify the EXE.
- Use -ArgumentList to pass parameters.
- Add -Wait if you want PowerShell to pause until the program exits.
- Use -NoNewWindow if you want the process to share the current console window, when supported.
Example:
Start-Process -FilePath 'C:\Tools\MyApp.exe' -ArgumentList '-silent','-log','C:\My Files\app.log' -Wait
5. Launch an EXE by Full Path from a Script
When you write scripts that run on different machines, using a full path is often the safest approach. It reduces dependence on the current folder and avoids accidental failures if the working directory changes.
- Use a full absolute path to the EXE.
- Store paths in variables if the location may change.
- Combine the path with the call operator or Start-Process depending on whether you need simple execution or more control.
Example using a variable:
$appPath = 'C:\Program Files\Vendor\App\App.exe' & $appPath
Common Problems When Running EXE Files in PowerShell
If an EXE does not launch correctly, the problem is usually one of a few common issues rather than PowerShell itself.
- The path is wrong or incomplete.
- The file name contains spaces and is not quoted properly.
- You forgot to use .\ for a file in the current folder.
- The program needs elevated permissions.
- The EXE expects different arguments than the ones you passed.
- The file is blocked by Windows or security software.
Which Method Should You Use?
For quick manual use, running the EXE directly is usually enough. For scripts, the call operator is often the cleanest choice. If you need better process control, use Start-Process. And if the file lives in a fixed location or alongside your script, a full path is usually the most reliable approach.
- Direct execution: best for quick commands in the console.
- Call operator (&): best for scripts and variables.
- Arguments after the EXE: best when the program needs switches or files.
- Start-Process: best for waiting, background execution, or more control.
- Full path execution: best for reliability in scripts and automation.
Example Cheat Sheet
Here are the most common patterns in one place:
- .\MyApp.exe
- & 'C:\Tools\MyApp.exe'
- & 'C:\Tools\MyApp.exe' -silent -log 'C:\Logs\app.log'
- Start-Process -FilePath 'C:\Tools\MyApp.exe' -ArgumentList '-silent' -Wait
- $app = 'C:\Program Files\Vendor\App\App.exe'; & $app