It is currently October 19th, 2018, 12:31 pm

Show COM ports in skin [Solved]

General topics related to Rainmeter.
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Show COM ports in skin [Solved]

Benik3 » March 24th, 2017, 12:49 pm

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
jsmorley
Developer
Posts: 18104
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Show COM ports in skin

jsmorley » March 24th, 2017, 12:54 pm

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/
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Re: Show COM ports in skin

Benik3 » March 24th, 2017, 2:27 pm

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
Brian
Developer
Posts: 1783
Joined: November 24th, 2011, 1:42 am
Location: Ohio

Re: Show COM ports in skin

Brian » March 28th, 2017, 6:47 am

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
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Re: Show COM ports in skin

Benik3 » March 28th, 2017, 7:50 am

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 :)
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Re: Show COM ports in skin

Benik3 » January 8th, 2018, 2:14 pm

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 :)
You do not have the required permissions to view the files attached to this post.
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Re: Show COM ports in skin

Benik3 » August 8th, 2018, 8:25 pm

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 :)
You do not have the required permissions to view the files attached to this post.
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Re: Show COM ports in skin [Solved]

Benik3 » August 19th, 2018, 3:21 pm

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
You do not have the required permissions to view the files attached to this post.
pauloctavio
Posts: 2
Joined: October 3rd, 2018, 7:28 pm

Re: Show COM ports in skin [Solved]

pauloctavio » October 3rd, 2018, 7:32 pm

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).Audacity Find My iPhone Origin
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.
Last edited by pauloctavio on October 4th, 2018, 6:55 pm, edited 1 time in total.
Benik3
Posts: 7
Joined: March 24th, 2017, 12:34 pm

Re: Show COM ports in skin [Solved]

Benik3 » October 3rd, 2018, 7:45 pm

You are right, it doesn't work with virtual COM :)
Check the vbscript in my rainmeter skin ;)