Page 1 of 2

Show COM ports in skin [Solved]

Posted: March 24th, 2017, 12:49 pm
by Benik3
Hello.

Does anyone have an idea, if it's possible to show COM number + name in rainmeter skin? (e.g. COM3 - USB serial, like in HW manager).
I use in work a lot these USB to serial converters (even more then one at one time) and it's pretty annoying to still looks into HW manager which one is the right which I want to use (because the SW just show COM1-10).

Thank you :)

Re: Show COM ports in skin

Posted: March 24th, 2017, 12:54 pm
by jsmorley
There is nothing native to Rainmeter that can do this, but if you can get the information from some external command line utility, something like WMIC perhaps with something like wmic path Win32_SerialPort, then you can execute those commands with RunCommand, and deal with the results as you like.

https://docs.rainmeter.net/manual/plugins/runcommand/

Re: Show COM ports in skin

Posted: March 24th, 2017, 2:27 pm
by Benik3
Thanks for reply.

I tried the wmic, but it doesn't work for the USB-Serial dongle. Probably because it's Virtual COM Port (VCP).
The same with command in power sheel Get-WMIObject Win32_SerialPort | Select-Object Name,DeviceID,Description
which show nice list, but only for real serial ports.

I found another command - chgport, which report this:
AUX = \DosDevices\COM1
COM1 = \Device\Serial0
COM7 = \Device\VCP0

That's more usable, but still not exactly what I wanted.
I will try to search something more...

Re: Show COM ports in skin

Posted: March 28th, 2017, 6:47 am
by Brian
I was going to suggest the change port /query command, but I bet it is the long version of the command you tried above: chgport.

I don't have any virtual com ports, so I can't really test, but you could try looking at all your plug and play devices with this command: wmic path win32_pnpentity. You would probably need to use the 'PNPDeviceID' property as a filter, but I am not positive on that.

You could also try the mode command as well.

Or you could try the .vbs or .exe from here: https://github.com/todbot/usbSearch/ (I think it uses the wmic command from above to work, but not 100% on that).

-Brian

Re: Show COM ports in skin

Posted: March 28th, 2017, 7:50 am
by Benik3
Thanks for reply.

The mode command isn't exactly what I want, because it doesn't show any name, only COM+number.
The wmic methode is really used by the .vbs script, I already found this. But for some reason the script doesn't work any more on win10 (Error 800A000D type mismatch 'objRgx.Execute' on line 45). Unfortunately my programming skill is not so high to solve this problem :(

I also found this: http://www.naughter.com/enumser.html
There is lot of methods to enumerate the COM ports, but again, my programming skills are not so high and also I don't have much time right now.
But maybe in future I will got it working :)

Re: Show COM ports in skin

Posted: January 8th, 2018, 2:14 pm
by Benik3
Hello.

I have finally fixed vbscript for listing COM ports on windows.
I didn't try any way how to put it into Rainmeter, but if anyone is interested, here you go :)

Re: Show COM ports in skin

Posted: August 8th, 2018, 8:25 pm
by Benik3
Hello.

After long time I again returned to Listing of COM ports in Rainmeter and I was successful :)
It's not something special, but it works! :D
In attachment you can find .ini for Rainmeter and .exe (which is compiled the vbs) for listing.

Maybe other people which works a lot with COM converters etc. will find it useful :)

Re: Show COM ports in skin [Solved]

Posted: August 19th, 2018, 3:21 pm
by Benik3
New version :)
- fixed problem with showing COMs with number 10+
- COM ports are now sorted ascended
- removed .exe and leave just the .vbs
- packed to .rmskin

Re: Show COM ports in skin [Solved]

Posted: October 3rd, 2018, 7:32 pm
by pauloctavio
Benik3 wrote:Hello.

Does anyone have an idea, if it's possible to show COM number + name in rainmeter skin? (e.g. COM3 - USB serial, like in HW manager).
I use in work a lot these USB to serial converters (even more then one at one time) and it's pretty annoying to still looks into HW manager which one is the right which I want to use (because the SW just show COM1-10).

Thank you :)
I attempted the wmic, however it doesn't work for the USB-Serial dongle. Presumably in light of the fact that it's Virtual COM Port (VCP). The equivalent with order in power sheel Get-WMIObject Win32_SerialPort | Select-Object Name,DeviceID,Description which demonstrate decent rundown, yet just for genuine serial ports.

Re: Show COM ports in skin [Solved]

Posted: October 3rd, 2018, 7:45 pm
by Benik3
You are right, it doesn't work with virtual COM :)
Check the vbscript in my rainmeter skin ;)