I'm in E:\blah\blah but I need to run an .exe from E:\folder name\prgm.exe

However, I am trying to call this without having to do cd ..

I read that just typing E:\folder name\prgm.exe should work. However when I try this I get an error:

E:\folder is not recognized as an external or internal command.

I'm running Windows 7 if that helps.

| improve this question | | | | |

E:\folder name\prgm.exe works if the folder name has no space in it.


  1. Rename the folder so it has no space.
  2. Use quotes. (e.g. "E:\folder name\prgm.exe")
  3. Or add E:\folder name to the path.

Use option 3) if it is an often used program.
Use option 2) for single or rare invokations.

| improve this answer | | | | |
  • Thank you! I had originally tried moving it into a folder without a space, but it wasn't working since the command required an input file argument, for which I was forgetting the E:\... in front of that as well. I couldn't do the quotes since i was running this command from MATLAB which itself required quotes for syntax purposes. Thank you again! – Bob Oct 20 '12 at 1:38

Just a small addition to what has been answered. If there is a flag or an option to the command it would have to be outside of the quotation marks example, from you blah blah folder

E:\blah\blah>"E:\folder name\prgm.exe" -t -l 1000
| improve this answer | | | | |
  • This is really a comment and not an answer to the original question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. Please read Why do I need 50 reputation to comment? What can I do instead? – DavidPostill Feb 6 '16 at 22:06
  • 2
    That was my first intention but due to a low number of rep points I couldn't comment, that's why I had to write a reply. – nassim Feb 21 '16 at 15:50
  • I understand why you did it. But please don't do that. – DavidPostill Feb 21 '16 at 16:47

Just for completeness' sake, I would like to note that in addition to Hennes' answer, there is a fourth option, though in fact you might find it too similar to cd:

Enter pushd E:\folder name and your working directory changes to the specified drive and folder (no quotes required) in one easy step; returning to the previous working directory is a no-brainer as well with a simple popd

| improve this answer | | | | |
  • This solved my problem (thanks mousio) pushd %~dp0, then ... execute whatever, then popd – arkod Apr 22 '15 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.