Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #103: operators on strike due to broken coffee machine


comp / comp.lang.tcl / Re: Find all COM ports (Windows)

SubjectAuthor
* Find all COM ports (Windows)Helmut Giese
+* Re: Find all COM ports (Windows)Ralf Fassel
|`- Re: Find all COM ports (Windows)Helmut Giese
`* Re: Find all COM ports (Windows)greg
 `- Re: Find all COM ports (Windows)Helmut Giese

1
Subject: Find all COM ports (Windows)
From: Helmut Giese
Newsgroups: comp.lang.tcl
Organization: ratiosoft
Date: Thu, 13 Jun 2024 08:14 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hgiese@ratiosoft.com (Helmut Giese)
Newsgroups: comp.lang.tcl
Subject: Find all COM ports (Windows)
Date: Thu, 13 Jun 2024 10:14:09 +0200
Organization: ratiosoft
Lines: 6
Message-ID: <p7al6jtvn6lejg1dci3967j2g2gnd0i6hj@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 13 Jun 2024 10:14:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="29acbc3ee68e2cd5011134a1ef34bc46";
logging-data="2293314"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LCh+3L1G6pkv9xfFFq0iu"
Cancel-Lock: sha1:9V1KVWXw6Yc6OwIsFOtqZ9uluwE=
X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
View all headers

Hello out there,
is there a way to find all COM ports which currently exist on a
Windows machine? IIRC I once had a twapi routine which could do that
but either I am wrong or I cannot find it anymore.
Any help will be greatly appreciated
Helmut

Subject: Re: Find all COM ports (Windows)
From: Ralf Fassel
Newsgroups: comp.lang.tcl
Date: Thu, 13 Jun 2024 08:40 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralfixx@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: Find all COM ports (Windows)
Date: Thu, 13 Jun 2024 10:40:28 +0200
Lines: 34
Message-ID: <ygamsnpqlqb.fsf@akutech.de>
References: <p7al6jtvn6lejg1dci3967j2g2gnd0i6hj@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net BDFGx9pW/qE36cZ56YhU2ALZWgWVH4Myc/StatkK8giupSdPc=
Cancel-Lock: sha1:7XyIaK2P+oq9+B4ip4IPpSi7iO4= sha1:SshyoM7kDzHecADPSP2zkxIHZ2Q= sha256:HLk4AevnkYf+02tdosrlmdmtN3o9bNobo2oZAajCTYs=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
View all headers

* Helmut Giese <hgiese@ratiosoft.com>
| is there a way to find all COM ports which currently exist on a
| Windows machine? IIRC I once had a twapi routine which could do that
| but either I am wrong or I cannot find it anymore.
| Any help will be greatly appreciated

Using the registry package:

# Retrieve actually available com-ports from Windows registry.
proc get_serial_ports_from_windows_registry {{hwpath 0}} {
set ComPorts [list]
#
# Get available com-ports from windows registry
#
package require registry
set serial_base "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM"

if {![catch { registry values $serial_base } values]} {
foreach valueName $values {
if {![catch {string trim [registry get $serial_base $valueName]} port]} {
if {$hwpath} {
lappend ComPorts "\\\\.\\$port"
} else {
lappend ComPorts $port
}
}
}
set ComPorts [lsort $ComPorts]
}
return $ComPorts
}

HTH
R'

Subject: Re: Find all COM ports (Windows)
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 13 Jun 2024 18:52 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: Find all COM ports (Windows)
Date: Thu, 13 Jun 2024 20:52:53 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v4ff65$2dbvv$1@dont-email.me>
References: <p7al6jtvn6lejg1dci3967j2g2gnd0i6hj@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 13 Jun 2024 20:52:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c30d4eac4f5a2fe7ee74249596c63f1c";
logging-data="2535423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+E4CJFO67azwL5sUVvOTeThMlpj9OCJjw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:EKBhsyCFV7vsuQlteu5jYtNVJO0=
Content-Language: de-DE
In-Reply-To: <p7al6jtvn6lejg1dci3967j2g2gnd0i6hj@4ax.com>
View all headers

Am 13.06.24 um 10:14 schrieb Helmut Giese:
> Hello out there,
> is there a way to find all COM ports which currently exist on a
> Windows machine? IIRC I once had a twapi routine which could do that
> but either I am wrong or I cannot find it anymore.
> Any help will be greatly appreciated
> Helmut

Hello,

https://wiki.tcl-lang.org/page/serial+ports+on+Windows

Gregor

Subject: Re: Find all COM ports (Windows)
From: Helmut Giese
Newsgroups: comp.lang.tcl
Organization: ratiosoft
Date: Fri, 14 Jun 2024 15:09 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hgiese@ratiosoft.com (Helmut Giese)
Newsgroups: comp.lang.tcl
Subject: Re: Find all COM ports (Windows)
Date: Fri, 14 Jun 2024 17:09:18 +0200
Organization: ratiosoft
Lines: 34
Message-ID: <m0no6j18697c43pq4rivtd71cl3ld462tt@4ax.com>
References: <p7al6jtvn6lejg1dci3967j2g2gnd0i6hj@4ax.com> <ygamsnpqlqb.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 14 Jun 2024 17:09:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3caeb8e533b4caa81fd69bb1389e509d";
logging-data="3096774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199u4AmBKM2KT9QSPtD2VmL"
Cancel-Lock: sha1:jp7O6JL+h3Bu7HTMDJyi6lMm5zA=
X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
View all headers

Hello Ralf;
>Using the registry package:
>
># Retrieve actually available com-ports from Windows registry.
>proc get_serial_ports_from_windows_registry {{hwpath 0}} {
> set ComPorts [list]
> #
> # Get available com-ports from windows registry
> #
> package require registry
> set serial_base "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM"
>
> if {![catch { registry values $serial_base } values]} {
> foreach valueName $values {
> if {![catch {string trim [registry get $serial_base $valueName]} port]} {
> if {$hwpath} {
> lappend ComPorts "\\\\.\\$port"
> } else {
> lappend ComPorts $port
> }
> }
> }
> set ComPorts [lsort $ComPorts]
> }
> return $ComPorts
>}
>
>HTH
>R'
thanks a lot - this was really helpful. Alas, it turned out that this
wasn't my real problem, so I will probably be back shortly - but then
with another thread.
Thanks again and have a nice weekend
Helmut

Subject: Re: Find all COM ports (Windows)
From: Helmut Giese
Newsgroups: comp.lang.tcl
Organization: ratiosoft
Date: Fri, 14 Jun 2024 15:15 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: hgiese@ratiosoft.com (Helmut Giese)
Newsgroups: comp.lang.tcl
Subject: Re: Find all COM ports (Windows)
Date: Fri, 14 Jun 2024 17:15:34 +0200
Organization: ratiosoft
Lines: 11
Message-ID: <69no6jthtm5g69fu543f0ojbj6i10m18n8@4ax.com>
References: <p7al6jtvn6lejg1dci3967j2g2gnd0i6hj@4ax.com> <v4ff65$2dbvv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 14 Jun 2024 17:15:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3caeb8e533b4caa81fd69bb1389e509d";
logging-data="3099276"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3jLlZoZTlt/z76XqBR5lK"
Cancel-Lock: sha1:ZPTZ9ns5cn6kLsEKI4Cshi1tT6Q=
X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
View all headers

Hello Gregor
>Hello,
>
>https://wiki.tcl-lang.org/page/serial+ports+on+Windows
>
wow, this page really seems to not let any question open. Alas, as I
mentioned in my answer to Ralf I meanwhile discovered that this was
not the real problem. But at least this question is solved once and
for all - and tucked away in my archive.
Thanks and have a nice weekend
Helmut

1

rocksolid light 0.9.8
clearnet tor