Question

I'm trying to execute an .exe file through CMD but I don't know what command I'd do to launch it. The only thing I can find is "How to execute .sh files on linux" but that's not what I want. Any suggestions?

Was it helpful?

Solution

If the executable for your program is "My Program" in directory "c:\My Directory" then to execute that program within a batch file, use

"C:\My Directory\My Program"

or

"C:\My Directory\My Program.exe"

or

START "" "C:\My Directory\My Program"

or equally

START "" "C:\My Directory\My Program.exe"

Use the START version if you want your batch to continue to the next line once it has started the program.

The "" in the start version is the window title. You can place any window title you want within those quotes, but should not omit that "titling" pair.

OTHER TIPS

Just type:

pushd THIS IS THE PATH TO YOUR FILE

This changes the directory.

then type the name of the exe file

myfile.exe

This is an example:

pushd C:\folder
myfile.exe

Just enter the name of the exe file with .exe at the end (the absolute path or at least the full name if you are in the correct directory)

If the program.exe is in the current working directory:

Linux ./program.exe

Windows program.exe

Specifying the absolute path always works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top