Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #134: because of network lag due to too many people playing deathmatch


comp / comp.lang.tcl / Re: how to pass /E:ON argument to cmd.exe using exec (Windows)

SubjectAuthor
* how to pass /E:ON argument to cmd.exe using exec (Windows)Michael Soyka
+* Re: how to pass /E:ON argument to cmd.exe using exec (Windows)Ashok
|`- Re: how to pass /E:ON argument to cmd.exe using exec (Windows)Michael Soyka
`* Re: how to pass /E:ON argument to cmd.exe using exec (Windows)et99
 `* Re: how to pass /E:ON argument to cmd.exe using exec (Windows)et99
  `- Re: how to pass /E:ON argument to cmd.exe using exec (Windows)Michael Soyka

1
Subject: how to pass /E:ON argument to cmd.exe using exec (Windows)
From: Michael Soyka
Newsgroups: comp.lang.tcl
Organization: self
Date: Mon, 30 Sep 2024 15:35 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mssr953@gmail.com (Michael Soyka)
Newsgroups: comp.lang.tcl
Subject: how to pass /E:ON argument to cmd.exe using exec (Windows)
Date: Mon, 30 Sep 2024 11:35:30 -0400
Organization: self
Lines: 20
Message-ID: <vdegg2$29idv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Sep 2024 17:35:30 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4fd56f04d9d4f620ef90eb1efdc2f2eb";
logging-data="2410943"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oyQ0QXvia/W5GPV3OWq/e"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Jj7iae7aDfDlX79DFdP1375UEUM=
Content-Language: en-US
View all headers

For a change of pace, this will not be a Tcl 9 question (I'm using 8.6.14).

Using tclsh, why does this succeed:
exec -- cmd /C dir

but this fails:
exec -- cmd /C /E:ON dir

with this message :
"The filename, directory name, or volume label syntax is incorrect."

I'm guessing that "exec" is treating /E:ON as a file spec (the colon
maybe?) and then changes it somehow.

A followup question is how can I see what string is being presented to
to Windows?

Thanks for answering.

-mike

Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
From: Ashok
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 30 Sep 2024 16:34 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: apnmbx-public@yahoo.com (Ashok)
Newsgroups: comp.lang.tcl
Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
Date: Mon, 30 Sep 2024 22:04:31 +0530
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <vdejup$2a8ek$1@dont-email.me>
References: <vdegg2$29idv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Sep 2024 18:34:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="03d5e2828911bde06ad6befca2c7cff0";
logging-data="2433492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SLkXuPaIR0w9sz6WEdsHr"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JmgftHeMP2CdBMhj+CQZR6lPkU4=
Content-Language: en-US
In-Reply-To: <vdegg2$29idv$1@dont-email.me>
View all headers

Nothing to do with Tcl 8.6 either :-)

From the DOS prompt:

D:\src\tcl-csv\library>cmd /C /E:ON dir
The filename, directory name, or volume label syntax is incorrect.

The /C needs to be before dir

D:\src\tcl-csv\library>cmd /E:ON /C dir
Volume in drive D is DATA
Volume Serial Number is 8245-4F72

Directory of D:\src\tcl-csv\library
.....

On 9/30/2024 9:05 PM, Michael Soyka wrote:
> For a change of pace, this will not be a Tcl 9 question (I'm using 8.6.14).
>
> Using tclsh, why does this succeed:
>     exec -- cmd /C dir
>
> but this fails:
>     exec -- cmd /C /E:ON dir
>
> with this message :
>     "The filename, directory name, or volume label syntax is incorrect."
>
> I'm guessing that "exec" is treating /E:ON as a file spec (the colon
> maybe?) and then changes it somehow.
>
> A followup question is how can I see what string is being presented to
> to Windows?
>
> Thanks for answering.
>
> -mike

Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
From: Michael Soyka
Newsgroups: comp.lang.tcl
Organization: self
Date: Mon, 30 Sep 2024 16:57 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mssr953@gmail.com (Michael Soyka)
Newsgroups: comp.lang.tcl
Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
Date: Mon, 30 Sep 2024 12:57:07 -0400
Organization: self
Lines: 53
Message-ID: <vdel93$29rc3$1@dont-email.me>
References: <vdegg2$29idv$1@dont-email.me> <vdejup$2a8ek$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Sep 2024 18:57:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4fd56f04d9d4f620ef90eb1efdc2f2eb";
logging-data="2420099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zWAtdLUvXMDr6SMvEOUYx"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fyTBSAuIt3ksSA3Qo59Uy7nIfMw=
In-Reply-To: <vdejup$2a8ek$1@dont-email.me>
Content-Language: en-US
View all headers

Once again, read the fine manual before blaming Tcl!

Thanks Ashok!

And by the way, I love your book!

-mike

On 09/30/2024 12:34 PM, Ashok wrote:
> Nothing to do with Tcl 8.6 either :-)
>
>
> From the DOS prompt:
>
> D:\src\tcl-csv\library>cmd /C /E:ON dir
> The filename, directory name, or volume label syntax is incorrect.
>
> The /C needs to be before dir
>
> D:\src\tcl-csv\library>cmd /E:ON /C dir
>  Volume in drive D is DATA
>  Volume Serial Number is 8245-4F72
>
>  Directory of D:\src\tcl-csv\library
> ....
>
>
>
>
> On 9/30/2024 9:05 PM, Michael Soyka wrote:
>> For a change of pace, this will not be a Tcl 9 question (I'm using
>> 8.6.14).
>>
>> Using tclsh, why does this succeed:
>>      exec -- cmd /C dir
>>
>> but this fails:
>>      exec -- cmd /C /E:ON dir
>>
>> with this message :
>>      "The filename, directory name, or volume label syntax is incorrect."
>>
>> I'm guessing that "exec" is treating /E:ON as a file spec (the colon
>> maybe?) and then changes it somehow.
>>
>> A followup question is how can I see what string is being presented to
>> to Windows?
>>
>> Thanks for answering.
>>
>> -mike
>

Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
From: et99
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 30 Sep 2024 18:15 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et99@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
Date: Mon, 30 Sep 2024 11:15:53 -0700
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <vdepsp$2b6es$1@dont-email.me>
References: <vdegg2$29idv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Sep 2024 20:15:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="54df9f27a4c8d5e9dcacfd67ed670d31";
logging-data="2464220"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SLDOmw95rcsABG71QgcTD"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1dZEJXpX50i/flAz5kE9cJKZyLc=
In-Reply-To: <vdegg2$29idv$1@dont-email.me>
Content-Language: en-US
View all headers

On 9/30/2024 8:35 AM, Michael Soyka wrote:

>
> A followup question is how can I see what string is being presented to to Windows?
>

My goto tool is process explorer, much more detailed that windows task manager, just hover mouse over any process and it will tell you the command line that was ultimately received (or click and choose properties)

https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer

This is a no-install program, you can just run it.

Using twapi, and if you exec with & you will get the pid, you can then use:

twapi::get_process_commandline PID ?options?

-e

Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
From: et99
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 30 Sep 2024 18:33 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et99@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
Date: Mon, 30 Sep 2024 11:33:14 -0700
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <vdeqta$2b6es$2@dont-email.me>
References: <vdegg2$29idv$1@dont-email.me> <vdepsp$2b6es$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Sep 2024 20:33:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="54df9f27a4c8d5e9dcacfd67ed670d31";
logging-data="2464220"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+js3JNdqi1e44NcTQykoEG"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jhAy3bFyCnLh8oW97k/2WtHuv1w=
Content-Language: en-US
In-Reply-To: <vdepsp$2b6es$1@dont-email.me>
View all headers

On 9/30/2024 11:15 AM, et99 wrote:
> On 9/30/2024 8:35 AM, Michael Soyka wrote:
>
>>
>> A followup question is how can I see what string is being presented to to Windows?
>>
>
> My goto tool is process explorer, much more detailed that windows task manager, just hover mouse over any process and it will tell you the command line that was ultimately received (or click and choose properties)
>
> https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer
>
> This is a no-install program, you can just run it.
>
> Using twapi, and if you exec with & you will get the pid, you can then use:
>
> twapi::get_process_commandline PID ?options?
>
>
> -e
>
Hmmm, it just occurred to me that if the process dies immediately, you might not have a chance with process explorer, and don't know if the get_process_commandline will be quick enough either.

Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
From: Michael Soyka
Newsgroups: comp.lang.tcl
Organization: self
Date: Mon, 30 Sep 2024 21:03 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mssr953@gmail.com (Michael Soyka)
Newsgroups: comp.lang.tcl
Subject: Re: how to pass /E:ON argument to cmd.exe using exec (Windows)
Date: Mon, 30 Sep 2024 17:03:59 -0400
Organization: self
Lines: 34
Message-ID: <vdf3o0$2chsp$1@dont-email.me>
References: <vdegg2$29idv$1@dont-email.me> <vdepsp$2b6es$1@dont-email.me>
<vdeqta$2b6es$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Sep 2024 23:04:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="4fd56f04d9d4f620ef90eb1efdc2f2eb";
logging-data="2508697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6BxHUcj+U8LVvdTcxyYEj"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gQMMNua66mfUQUM0xTcimvt77Tw=
In-Reply-To: <vdeqta$2b6es$2@dont-email.me>
Content-Language: en-US
View all headers

On 09/30/2024 2:33 PM, et99 wrote:
> On 9/30/2024 11:15 AM, et99 wrote:
>> On 9/30/2024 8:35 AM, Michael Soyka wrote:
>>
>>>
>>> A followup question is how can I see what string is being presented
>>> to to Windows?
>>>
>>
>> My goto tool is process explorer, much more detailed that windows task
>> manager, just hover mouse over any process and it will tell you the
>> command line that was ultimately received (or click and choose
>> properties)
>>
>> https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer
>>
>> This is a no-install program, you can just run it.
>>
>> Using twapi, and if you exec with & you will get the pid, you can then
>> use:
>>
>> twapi::get_process_commandline PID ?options?
>>
>>
>> -e
>>
> Hmmm, it just occurred to me that if the process dies immediately, you
> might not have a chance with process explorer, and don't know if the
> get_process_commandline will be quick enough either.
>
Yes, in my case, the process would die almost immediately but, if /K is
used instead of /C, the process does hang around and your suggestions
would work. Thanks for the advice.
-mike

1

rocksolid light 0.9.8
clearnet tor