It is currently April 27th, 2024, 6:29 am

RunCommand does not appear to work

Get help with creating, editing & fixing problems with skins
i420bdawg
Posts: 1
Joined: September 14th, 2023, 7:45 pm

RunCommand does not appear to work

Post by i420bdawg »

I have tried multiple ways to get this to work, but for some reason in Rainmeter Skins section, measureLinkSpeed never gets a value, but if I run the powershell command in Powershell it returns "1 Gbps". I have even tried Prepending the command with Write-Output and encapsulating the command in $() even encapsulating the Parameter in double quotes does not seem to work. Tried running Rainmeter as Administrators with still no luck

And only 1 entry in debug logs for RunCommand:
Plugin loaded: C:\Program Files\Rainmeter\Plugins\RunCommand.dll

Also tried with FinishAction to update the Meter Text value instead of the meter calling on the measure directly.

Pictures (did not work with img tags):
Rainmeter Skins Measures Value
Powershell Output

Code: Select all

[measureLinkSpeed]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=(Get-NetAdapter | Where-Object { $_.Status -eq 'Up' } | Select-Object -First 1).LinkSpeed
OutputType=ANSI
State=Hide

[meterLinkSpeedValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureLinkSpeed
X=200
Y=0r
W=190
H=14
I would appreciate any guidance.
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RunCommand does not appear to work

Post by balala »

i420bdawg wrote: September 14th, 2023, 8:10 pm I would appreciate any guidance.
At least by the posted code, you never get executed the [measureLinkSpeed] measure. There is needed a bang to execute (run) the specified command. You can either add a LeftMouseUpAction=[!CommandMeasure "measureLinkSpeed" "Run"] option for instance to the [Rainmeter] section or can add the same bang into an OnRefreshaCtion option into the same [Rainmeter] section: OnRefreshAction=[!CommandMeasure "measureLinkSpeed" "Run"].
In first case you'll have to click the visible part of the skin (assuming there is something visible before you get the command executed) in second case the command is executed right after activating / refreshing the skin. It's up to you which solution do you choose.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2611
Joined: March 23rd, 2015, 5:26 pm

Re: RunCommand does not appear to work

Post by SilverAzide »

i420bdawg wrote: September 14th, 2023, 8:10 pm
Another approach is to use the SysInfo measure. ADAPTER_RECEIVE_SPEED should return the same value as the PowerShell command, only much much faster and way less complex.
Gadgets Wiki GitHub More Gadgets...