In my skin, I have:
[measureGW]
Measure=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=Ethernet
This does not work, it displays 0 instead of the Default Gateway IP Address of the Network Adapter called 'Ethernet'.
ipconfig shows the expected values.
If I replace GATEWAY_ADDRESS with IP_ADDRESS it works fine, displaying the IP Address of the network adapter.
Any ideas?
I've tried SysInfoData=0, 1 2 etc. and SysInfoType=GATEWAY_ADDRESS_V4, but it's the same result
I get the same result if I use SysInfoType=RainyDaze!
Has anyone got this working?
It is currently April 27th, 2024, 7:03 am
SysInfo doesn't work for GATEWAY_ADDRESS
-
- Posts: 3
- Joined: February 13th, 2024, 2:28 pm
SysInfo doesn't work for GATEWAY_ADDRESS
Last edited by RainyDaze on February 13th, 2024, 3:58 pm, edited 1 time in total.
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: SysInfo doesn't work for GATEWAY_ADDRESS
Try using the default SysInfoData=Best option (or simply remove the SysInfoData option, to use its default value).
-
- Posts: 3
- Joined: February 13th, 2024, 2:28 pm
Re: SysInfo doesn't work for GATEWAY_ADDRESS
@balala same result I'm afraid
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: SysInfo doesn't work for GATEWAY_ADDRESS
Then no more idea from my part. Someone else will have to help you here. Sorry...
-
- Rainmeter Sage
- Posts: 7175
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: SysInfo doesn't work for GATEWAY_ADDRESS
This works for me:RainyDaze wrote: ↑February 13th, 2024, 3:11 pm In my skin, I have:
[measureGW]
Measure=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=Ethernet
This does not work, it displays 0 instead of the Default Gateway IP Address of the Network Adapter called 'Ethernet'.
ipconfig shows the expected values.
If I replace GATEWAY_ADDRESS with IP_ADDRESS it works fine, displaying the IP Address of the network adapter.
Any ideas?
I've tried SysInfoData=0, 1 2 etc. and SysInfoType=GATEWAY_ADDRESS_V4, but it's the same result
I get the same result if I use SysInfoType=RainyDaze!
Has anyone got this working?
Code: Select all
[Variables]
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,255,0,255
---Measures---
[Outcome]
Measure=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=Best
; or Start > Settings > Network & Internet > View Hardware And Connection Properties > (an adapter whose Connectivity has Internet) > Description
DynamicVariables=1
---Meters---
[Result]
Meter=String
AntiAlias=1
MeasureName=Outcome
Text=Result = %1
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 16175
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: SysInfo doesn't work for GATEWAY_ADDRESS
Don't know if it works for OP, however you gave me an idea. Your description about how to get the proper SysInfoData (the commented out line in the [Outcome] measure of your code) proved correct. According to it, I got the name of my adapter and got the code working with that name. Even if in my case the SysInfoData=Best does work, if for anyone it doesn't, using your description anyone can get the proper value of this option and can use it to get the proper gateway.
Not sure I am correct, but hope I am...
-
- Rainmeter Sage
- Posts: 2611
- Joined: March 23rd, 2015, 5:26 pm
Re: SysInfo doesn't work for GATEWAY_ADDRESS
Powershell:
Using either the "Interface Name" or "Connection Name" in SysInfoData should work. Make sure your Connection Name matches what you see via this command. Windows sometimes "helpfully" hides the numeric suffix.
Code: Select all
Get-WmiObject -Class MSFT_NetAdapter -Namespace root\StandardCimv2 | Sort-Object -Property InterfaceType, Virtual, InterfaceDescription | Format-Table -Property @{Label='Interface Name'; Expression={$_.InterfaceDescription}}, @{Label='Connection'; Expression={$_.Name}}, Virtual, State, @{Label='Type'; Expression={$_.InterfaceType}} -AutoSize
-
- Rainmeter Sage
- Posts: 7175
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: SysInfo doesn't work for GATEWAY_ADDRESS
Yep, there are lots of ways to get the proper value for SysInfoData in this case, either through Windows Settings, Control Panel, Rainmeter itself (with or without the Debug box being checked), PowerShell (like SilverAzide described), command line, etc. I imagined the Windows Settings way would be "easier" / more "friendly" for the regular user, that's why I added that comment about it. When things don't work, simplifying them sometimes helps.balala wrote: ↑February 13th, 2024, 7:27 pm Don't know if it works for OP, however you gave me an idea. Your description about how to get the proper SysInfoData (the commented out line in the [Outcome] measure of your code) proved correct. According to it, I got the name of my adapter and got the code working with that name. Even if in my case the SysInfoData=Best does work, if for anyone it doesn't, using your description anyone can get the proper value of this option and can use it to get the proper gateway.
Not sure I am correct, but hope I am...
-
- Posts: 3
- Joined: February 13th, 2024, 2:28 pm
Re: SysInfo doesn't work for GATEWAY_ADDRESS
No, still not working. I'm using Rainmeter 4.5.13.3632 (64bit) on Windows 10 Enterprise N 2016 LTSB 1607 64-bit (build 14393)
I get nothing in the logs, other than reading the ini files and 'Refreshing skin'
I've tried with the following but it just returned blank:
I get nothing in the logs, other than reading the ini files and 'Refreshing skin'
I've tried with the following but it just returned blank:
Code: Select all
[measureGW1]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Program=PowerShell
Parameter=(Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Property DefaultIPGateway).DefaultIPGateway
OutputType=ANSI
UpdateRate=14400
OnOutputAction=[!CommandMeasure measureGW1 "Run"]
Last edited by balala on February 15th, 2024, 3:11 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting codes. It's the </> button.
Reason: Please use <code> tags whenever are you posting codes. It's the </> button.
-
- Rainmeter Sage
- Posts: 7175
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: SysInfo doesn't work for GATEWAY_ADDRESS
That's strange. By the way, there's no OnOutputAction in Rainmeter (or maybe you misspelled OnUpdateAction), so you should forget about Rainmeter for a moment and first try the appropriate command to get the gateway address in PowerShell itself. Also, just to be sure, does the Settings location mentioned in the code comment above provide any gateway addresses? Some screenshots with the retrieved and not retrieved gateway might help to at least identify where the problem resides.RainyDaze wrote: ↑February 15th, 2024, 10:33 am No, still not working. I'm using Rainmeter 4.5.13.3632 (64bit) on Windows 10 Enterprise N 2016 LTSB 1607 64-bit (build 14393)
I get nothing in the logs, other than reading the ini files and 'Refreshing skin'
I've tried with the following but it just returned blank:
[measureGW1]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Program=PowerShell
Parameter=(Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Property DefaultIPGateway).DefaultIPGateway
OutputType=ANSI
UpdateRate=14400
OnOutputAction=[!CommandMeasure measureGW1 "Run"]