It is currently April 24th, 2024, 3:27 pm

Start Command on Network Change

General topics related to Rainmeter.
tschreiber
Posts: 1
Joined: September 6th, 2016, 8:05 am

Start Command on Network Change

Post by tschreiber »

Hello,

i am using rainmeter to display the network settings on our computers.

what i want to achieve is, that rainmeter "triggers" a command on network change but not on start of rainmeter.

i came across the "onchangeaction" command - this works correctly, but i only want the command to be executed if the computer is on a specific network. how do i "connect" the onchangeaction with ifmatch statement?

this is what i got:

Code: Select all

[measureIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=Best
OnChangeAction=[cmd /c START /MIN gpupdate /target:user]
#IfMatch=(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)
#IfMatchAction=cmd /c START /MIN gpupdate /target:user
DynamicVariables=1
thanks for any help in advance!

Greetings
Last edited by eclectic-tech on October 18th, 2018, 11:26 am, edited 1 time in total.
Reason: Please use code tags.
User avatar
balala
Rainmeter Sage
Posts: 16165
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Start Command on Network Change

Post by balala »

First I probably would use a RunCommand plugin measure, to can hide the cmd.exe (DOS) Command Prompt window. For this you need to add the following measure:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=cmd /c START /MIN gpupdate /target:user
State=Hide
If added, you need to use this measure. This can be done through a !CommaneMeasure bang ([!CommandMeasure "MeasureRun" "Run"]), added to the IfMatchAction option of [measureIP] measure: IfMatchAction=[!CommandMeasure "MeasureRun" "Run"]
.
But here I have another concern / tip: you probably have tried to comment out the IfMatch / IfMatchAction options, adding the # character in front of them. Commenting out in Rainmeter is done with semicolon, not with dash. However you don't need anymore to comment out these options, so remove the dashes.