Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
Redmond desk3 min

How to Run Windows Command-Line Apps from PowerShell and Windows Terminal

Run native Windows commands directly in PowerShell, use explicit paths for files in the current folder, and use Windows Terminal’s wt command when you want a new terminal launch.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

At a PowerShell prompt, type the executable and its arguments—for example, ping learn.microsoft.com. If the program is in the current folder, call it with an explicit path such as ./tool.exe is not valid PowerShell syntax; use .tool.exe. Windows Terminal is the app that hosts PowerShell or another shell; PowerShell interprets the command.

How do I run a command in PowerShell?

Open a PowerShell tab in Windows Terminal, or start PowerShell in another terminal host. Enter the command and its arguments at the prompt:

As an Amazon Associate I earn from qualifying purchases.

ping learn.microsoft.com

PowerShell can run commands available on the system, including native Windows executables. For a command installed on your PATH, its name is usually enough. Microsoft’s PowerShell documentation describes how PowerShell runs commands, including native programs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I run an .exe in the current directory?

Use an explicit relative path or the executable’s full path. PowerShell does not search the current directory just because you type a bare executable name. For example:

#1 Best Overall
.tool.exe

You can also use a full path, such as C:Toolstool.exe. Specifying the path makes clear which file you intend to run; a bare name can resolve to an alias, function, cmdlet, or executable found elsewhere. See Microsoft’s command precedence reference.

How should I pass paths and arguments?

Quote paths that contain spaces

PowerShell parses the command line before passing arguments to a native program. Put a path with spaces in quotes. If the executable path is stored in a variable, use the call operator (&) to invoke it:

$exePath = 'C:Program FilesExampletool.exe'
& $exePath -Version

How quotes and special characters must be represented also depends on how the target program parses its command line. Check that program’s documentation when arguments contain embedded quotes, empty values, or other special characters.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Account for PowerShell version differences

PowerShell 7.3 made the newer native argument-passing behavior the default. Older versions and PowerShell’s legacy mode can handle some complex arguments differently. Check your version with $PSVersionTable.PSVersion and test the exact command if argument details matter. Microsoft explains the behavior in about parsing.

The Windows-only --% stop-parsing token can pass the rest of a command line to a native program with less PowerShell interpretation. It also prevents normal PowerShell interpretation of that remainder, so it is a limited option, not a general substitute for correct quoting.

Handle batch files carefully

PowerShell runs .bat and .cmd files through cmd.exe. Arguments are passed as raw command-line strings to that shell, which makes careful handling especially important. Do not place untrusted input into a batch-file command string; use a safer structured interface if the program provides one.

Rank #3
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.

How do I open a command in a new Windows Terminal tab?

Use the wt command to ask Windows Terminal to open its default shell and run a command:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wt ping learn.microsoft.com

Windows Terminal also supports actions such as new-tab and options for choosing the shell. Consult Microsoft’s Windows Terminal command-line arguments reference for the available syntax and examples for PowerShell or Command Prompt.

If wt is not recognized, check that the Windows Terminal app execution alias is enabled in Windows Settings and that %LOCALAPPDATA%MicrosoftWindowsApps is on your PATH.

Rank #4
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.

Be careful when combining Terminal actions

Semicolons can separate actions in Windows Terminal and have meaning in PowerShell, too. Microsoft documents ways to escape them or use --%, but cautions that these multi-action workarounds are not currently recommended: PowerShell may wait for the Terminal window to close before returning. For a simple command, launching it directly in the desired shell is less complicated.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should I run a command directly or use Start-Process?

For ordinary commands, invoke the executable directly. Use Start-Process when you need process-launch controls—for example, a different working directory, alternate credentials, a hidden console window, or redirected standard input, output, or error. It starts a process asynchronously by default.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Here is Microsoft’s parameter-hashtable pattern for redirecting a program’s streams:

$processOptions = @{
    FilePath = 'sort.exe'
    RedirectStandardInput = 'TestSort.txt'
    RedirectStandardOutput = 'Sorted.txt'
    RedirectStandardError = 'SortError.txt'
}
Start-Process @processOptions

When using ArgumentList, follow the Start-Process reference and quote arguments for the target program’s command-line parser.

How can I tell whether the program succeeded?

Native standard output is written to PowerShell’s Success stream, and native standard error goes to its Error stream. A program can write to standard error without that alone proving it failed. In the documented general behavior, a native program’s nonzero exit code makes $? false. PowerShell versions differ in some redirected-error and error-preference details, so do not treat every stderr message as a failed process or assume $ErrorActionPreference handles native exit codes uniformly. Microsoft documents the stream and exit behavior in about redirection.

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$245.99
Bestseller No. 2
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$285.00

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.