Article View: comp.lang.tcl
Article #73Re: something wrong with special char in "exec exploer.exe" command
From: et99
Date: Tue, 20 Oct 2026 06:36
Date: Tue, 20 Oct 2026 06:36
41 lines
2950 bytes
2950 bytes
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 On 10/19/2026 12:39 PM, meshparts wrote: > I'm using in Tcl with Windows > > exec explorer.exe /e, "[file nativename $path]" & > > to open files with the OS default program. > > Now I have an issue with a text file path that contains "=" in the file name, e.g. t=4.out > > The issue seems to be explorer.exe which does not like the "=" sign. > If I execute the command in cmd.exe and use double quotes, then the command works: > > explorer.exe /e, "t=4.out" & > > But executed from Tcl, it does not: > > exec explorer.exe /e, "t=4.out" & > > The result is, that the given file is not found and a generig Explorer window is opened instead of the file in my default text editor. > > I tried to force the double quotes by using \" and so on, but nothing worked. > > Any ideas? > > Thanks > Alex > >
Technical Details
Message-ID:
<11b724k$2ok9e$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11b5rl3$1fbh$1@tota-refugium.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: et99 <et99@rocketship1.me> Newsgroups: comp.lang.tcl Subject: Re: something wrong with special char in "exec exploer.exe" command Date: Mon, 19 Oct 2026 23:36:02 -0700 Organization: A noiseless patient Spider Lines: 41 Message-ID: <11b724k$2ok9e$1@dont-email.me> References: <11b5rl3$1fbh$1@tota-refugium.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 20 Oct 2026 06:36:05 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2904366"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/o4X7idnEFwrv+3MYOaX2X"; posting-host="5d8e684249bb2f3c460ee2bc3409ca9a" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:TjKqij7vsbpyurMipCEhHRS1u3E= sha256:aFGer+nIYpiRE3DBrSshVyrTbLn+RnolsUOzMva7CT0= sha1:jDoOpe2ncj8GRvnisFNsr6wmTr4= sha256:uo7WgAR+vlqljwMkoChkpC5S/8wjZRrov/QXlXkoIso= In-Reply-To: <11b5rl3$1fbh$1@tota-refugium.de> Content-Language: en-US