how to make registry changed values to take effect without signing out?

0

If I manually change registry key values using cmd. they failed to take effect/changes until I restart/sign-out my computer.

Eg.

reg ADD "HKEY_CURRENT_USER\Control Panel\Desktop" /v MouseWheelRouting /t REG_DWORD /d 2 /f

i have to restart/sign-out to them the changes to take effect

but I wanna find a way to make them work without having them to restart/sign-out my computer.

So, Is there simple possible way to this to happen? using batch/cmd.

Aravind .KEN

Posted 2018-05-05T15:29:23.047

Reputation: 99

I was wondering if after you set the registry key if running from command line WMIC PROCESS WHERE "Caption = 'explorer.exe'" CALL TERMINATE—not sure if elevated as administrator makes any difference or not either so consider testing with and without run as administrator—if that makes the changes effective without having to restart/sign-out. If so, please tag me back and I'll be happy to write up an answer with more detail if you want. Should be simple enough to test regardless. – Pimp Juice IT – 2018-05-27T05:00:58.557

Answers

0

Generally, you can get these new settings to take effect if you broadcast the WM_SETTINGCHANGE message.

In AutoIt, for example, you could do something like

#include <SendMessage.au3>
Dim Const $WM_SETTINGCHANGE = 0x001A
Local $hWnd = WinGetHandle("[CLASS:Shell_TrayWnd]")

If @error Then
    MsgBox(0, "", "An error occurred when trying to retrieve the window handle.")
    Exit
Else
    _SendMessage ($hWnd, $WM_SETTINGCHANGE)
EndIf

Patrick Seymour

Posted 2018-05-05T15:29:23.047

Reputation: 7 662

thx, but is there any simpler way using cmd only ? – Aravind .KEN – 2018-05-06T13:06:24.957