Show COM ports in skin [Solved]

General topics related to Rainmeter.

Show COM ports in skin [Solved]

March 24th, 2017, 12:49 pm
Benik3
   [5 posts]

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 :)
Last edited by Benik3 on August 8th, 2018, 8:26 pm, edited 1 time in total.
User avatar

Re: Show COM ports in skin

March 24th, 2017, 12:54 pm
jsmorley
Developer   [17820 posts]

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

March 24th, 2017, 2:27 pm
Benik3
   [5 posts]

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...
User avatar

Re: Show COM ports in skin

March 28th, 2017, 6:47 am
Brian
Developer   [1719 posts]

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

March 28th, 2017, 7:50 am
Benik3
   [5 posts]

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

January 8th, 2018, 2:14 pm
Benik3
   [5 posts]

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 :)
Attachments
listComPorts_fixed.zip
(1 KiB) Downloaded 26 times

Re: Show COM ports in skin

August 8th, 2018, 8:25 pm
Benik3
   [5 posts]

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 :)
Attachments
ComPorts.zip
(49.37 KiB) Downloaded 4 times

Return to “General Discussion”



Who is online

Users browsing this forum: No registered users and 2 guests