El 20/10/2026 a las 3:52, meshparts escribió:
> Am 20.10.2026 um 08:36 schrieb et99:
>> Hi:
>>
>> In cmd.exe, = (like , and ;) acts as an argument delimiter, the same as a space, unless it is inside double quotes. So an unquoted t=4.out can be split into t and 4.out. Tcl's exec only quotes arguments containing whitespace, a double quote, or one of & | ^ < > ! ( ). The = sign isn't on that list, so t=4.out reaches the command line unquoted and gets mangled, and the quotes in your script are eaten by Tcl's parser.
>>
>> Skip explorer and use start with an empty title:
>>
>> exec cmd /c start "" [file nativename $path] &
>>
>> The "" matters: start treats its first argument, if quoted as the window title, so without it a quoted path (for example one with spaces) can be taken as the title instead of the file. Tcl passes the empty argument through as "", so start gets a real (empty) title and opens the path with the default program.
>>
>> -e
>>
> Thank you! This is very important thing to know.
> So now I have the cmd and the twapi methods that seems to work fine.
> Still, which one should I use?
> Are there any other hidden traps that will crash either one?
I guess the person who could best answer this is the author of twapi (Ashok P. Nadkarni).
In any case, something to keep in mind:
«The START command uses the same underlying Windows Shell API (ShellExecute) that explorer.exe uses when you double-click a file. It looks at the file's extension, checks the registry for the associated "FileType" (managed by the assoc command), and then looks up the command associated with that FileType (managed by the ftype command) to launch the correct program. This ensures your script respects the user's personal application choices.» (Credit :
https://tutorialreference.com/batch-scripting/examples/faq/batch-script-how-to-open-a-file-with-its-default-program)
Alejandro