How to open file with default application in cmd?

You can use start to open the file with the associated application.


Resources :

  • Open a File in the Default Application using the Windows Command Line (without JDIC) (waybackmachine capture from Oct 30, 2010)

You can also use explorer.exe/explorer to open the file (e.g. explorer file.txt). This also works nicely if you use WSL, especially with an alias like alias open="explorer.exe" so you can just call it like, e.g., open file.txt.


In windows you can use start (http://ss64.com/nt/start.html).

start "" "%UserProfile%\%fileLocation%\%fileName%.%extension%"