Liu Chang asked a very similar question to this one here, Linux equivalent of the Mac OS X "open" command.
Is there a windows equivalent for the Mac OS X "open" command. I'm trying to run a profiler that will open it's results, but it's looking for the "open" command. Basically, the command needs to open a file from the command prompt as if it were double-clicked on in explorer.
Try
explorer <filename>
. For example I wanted to launch a folder namedabc
placed at desktop, so I used the commandIf you use cygwin (or git bash), here's a quick script hack. Change the EDITOR to be whatever you want:
Only explorer.exe appears to work under cygwin.
The closest thing available is
start
.If its first argument is double-quoted, that argument is treated as a window title rather than a filename. Thus, to use it robustly, add an empty string as the first argument:
Thank you to @Holger for pointing this out!
'start' is definitely the closest thing for Windows as @charles-duffy stated. Depending on your project there are also a few tools out there that solve this problem.
Node (opn)[https://github.com/sindresorhus/opn] is a pretty great solution to be totally cross platform
Just typing the file name into a console window will open the file in Windows. I tried several formats - .doc opened with OpenOffice, .mp3 opened with Windows Media Player, and .txt opened with Wordpad. This is the same behavior I experience when double clicking on the files.