[Refer to Microsoft documentation.]
MS-DOS shell built-in command called with a filename that invokes the executable associated with the filename's extension. Acts about like double-clicking on a file in File explorer. Usage example from Tcl:
eval exec [auto_execok start] {""} [list [file nativename $filename]]
On Tcl 8.5 (or later):
exec {*}[auto_execok start] "" [file nativename $filename]
which, if filename ends e.g. in .htm, calls up IE (if that's your default browser); Win Word for .doc, etc.
Nits: If the first parameter is quoted, "start" will take it for a window title. Add an empty string to avoid the problem (see below). COMMAND.COM, CMD.EXE and the console command-line tools misunderstand "/" in filenames. Use [file nativename] to cure that.
[Use in invoking browsers.]
To launch a Windows application (such as Tk) from a console application (such as Tcl) in such a way that it returns only after the subprocess has terminated, use
start /w wish83 myapp.tcl
As with most Windows command-line tools, see "start /?" from a command prompt for built-in help.
schlenk One caveat usually found the hard way, is the simple fact, that Microsoft found it amusing to implement start differently on Win9x and on Win2k/XP. So read its documentation before you use it. Try to start something like this on W95 and W2k an see what happens:
start {c:\program files\tcl\bin\wish84} myapp.tcl
Hint (this works on W2k):
start "" {c:\program files\tcl\bin\wish84} myapp.tcl
MHo: Some (other or additional) aspects and facts of start:
MJ - Because of the parsing exec performs with respect to, for instance, ampersands, the versions of start above will not work with, for instance, http://www.google.com/search?q=tcl&oe=utf-8 . With TWAPI it is possible to access the CreateProcess WIN32 API directly leading to the following version of start which will work even if $name includes spaces or other "strange" characters (& > etc)
proc start {name} { package require twapi ::twapi::create_process {} -cmdline "cmd /c start \"\" \"$name\"" -showwindow hidden }
[Explain winutils alternative--something like "winutils::shell myfile.doc", and so on]
JJS 8 June 2007 - In a unix CDE environment I think you would do something like
exec /usr/dt/bin/dtaction Open <file>