Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Windows XP, how does one open a file with its default application from the command line?

As far as I know, this should work from a command prompt or batch file:

start "path to my file"

Unfortunately in my case, this only opens a new command prompt window for most file types. (It does work for .exe file though...)

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

Try this.

START "" "path to my file"

The START command treats the first set of "" as the text to use for the title of the window, so just include an empty pair.

share|improve this answer
add comment

Don't use START. Just type the name of the file. readme.txt opens readme.txt in notepad

Note that if there are spaces in the name, you must handle them. A good way is to use double quotes. "read me.txt"

share|improve this answer
    
Under windows 7, you need the START command. –  Gerrit Jun 17 at 8:08
    
@Gerrit No, you don't. If the program in question is in your path and your default handlers are set up properly, all you have to do it provide the path and file name and it will open. –  kmort Jun 17 at 11:46
add comment

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.