It is currently July 13th, 2024, 9:08 am

RunCommand does not appear to work

Get help with creating, editing & fixing problems with skins
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

Parameter=(Get-NetAdapter | Where-Object { $_.Status -eq 'Up' } | Select-Object -First 1).LinkSpeed

I would appreciate any guidance.
User avatar
Rainmeter Sage
Posts: 16389
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
Rainmeter Sage
Posts: 2683
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...