views:

614

answers:

4

Liu Chang asked a very similar question to this one here, http://stackoverflow.com/questions/264395/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.

+7  A: 

The closest thing available is start.

Charles Duffy
For me "start <filename>" just opens up a new instance of the command prompt.
Thomas Owens
@Thomas Owens: That is the default behavior in NT-family Windows (the ones with the CMD.EXE shell). In the Win95 family, START works just as @Charles Duffy mentioned, but on NT you would say 'start "" filename' (note the double quotes to give an empty name to the command window).
crosstalk
+4  A: 

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.

Thomas Owens
I don't think this works in Win95 family (because it doesn't work in DOS, and the Win95 console window is basically DOS plus the ability to run Win32 console programs).
crosstalk
+1  A: 

I use to write

explorer.exe <file>
epatel
A: 

All three of these answers are correct, so I gave the accepted answer to the earliest submitted. Thanks for the help everyone.

jcnnghm