MicrosoftPowerShell

.EXE files, or executable files are something we see often.

you might also run executable (.exe) files directly fromWindows PowerShell.

In this article, we show you 4 methods to run .exe files directly inside PowerShell.

3 Ways To Run EXE Files Using PowerShell

The commands discussed in the methods below can also be applied to PowerShell scripts.

Moreover, some of them even allow you to send parameters/values to the executable file.

In the example below, we will be running Rufus.exe located at C:\Users\Subhan\Downloads.

Download Windows 11 IoT Enterprise LTSC ISO

Of course, this will change for you according to the files path and its name.

All it needs is a path and the name of the file to run.

The executable file will now run.

Startup folder in all versions of Windows

Note that it is crucial that you use .\ while running an executable file directly.

Otherwise, it will be considered a PowerShell command and you may see an error.

Heres how:

Use the following cmdlet to run an executable file:

Thats it!

Download Windows 11 Version 24H2

The executable file should now run.

Anything followed by the & call operator is considered a command by PowerShell.

This is the syntax to be used to run an executable file in PowerShell:

It is that simple.

0

Get weekly insights, tips and exclusive content delivered straight to your inbox.

Talk to us straight and get your questions answered right away

source: www.itechtics.com