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...)
4 Answers
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.
explorer "filename"works for xp and other windows (95 or higher) If it does not work, you haven't associated that extention type with a program.
2Don't use START. Just type the name of the file.readme.txt opens readme.txt in Notepad (or in whatever default .txt handler you have in place).
Note that if there are spaces in the name, you must handle them. A good way is to use double quotes."read me.txt"
Using PowerShell
Start-Process "<fullname>"