It is currently April 22nd, 2019, 11:07 am

Start Command on Network Change

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

Start Command on Network Change

tschreiber » October 18th, 2018, 7:20 am


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

OnChangeAction=[cmd /c START /MIN gpupdate /target:user]
#IfMatchAction=cmd /c START /MIN gpupdate /target:user
thanks for any help in advance!

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

Re: Start Command on Network Change

balala » October 18th, 2018, 5:47 pm

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

Parameter=cmd /c START /MIN gpupdate /target:user
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.