How do I run a .exe file from the command prompt?
For example, if the .exe file is located at C:\file.exe, how do I run this file when the prompt is currently in another location like D:\?
|
How do I run a .exe file from the command prompt? For example, if the .exe file is located at | ||||
|
feedback
|
This question came from our site for professional and enthusiast programmers.
|
You can either run it by using the explicit path:
or add its location to the path (I always have a c:\bin directory to hold my little snippets - not really a kosher location for multiple-user Windows, but none of my Windows installs are multiple-user):
Note that, with that second solution, you should be setting up your path so that it's available whenever you start up (in autoexec.bat if you're really using DOS or from the And, do note that, if you use the control panel solution, that doesn't affect currently open command windows - you'll need to shut them down and re-open to pick up the new environment variable. | |||||||||||||||
feedback
|
|
To switch drives, just type Let's say I am at
| |||
|
feedback
|
|
You should add the c:\ path into your Windows system PATH so whatever drive you are in and when you execute the file.exe windows will look at your defined path and run your program there. TO do this go to Windows -My computer -click right for Properties - Advanced Button - Environment Variables - at the buttom of the windows you will see the PATH - Edit it add ;c:\ and save This should work - I think it will need a reboot | |||
|
feedback
|
|
The best way to run an EXE file that you don't known its full name is: Assuming your file name is
| |||||
feedback
|