Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

Either:

  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.

share|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 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

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

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
share|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 at 22:06
    
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 at 15:50
    
I understand why you did it. But please don't do that. – DavidPostill Feb 21 at 16:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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