How do you swap the primary mouse button via commandline in Windows 8 without a reboot?

Swap mouse buttons from command line

We can swap mouse buttons by editing the registry value SwapMouseButtons under the registry key HKEY_CURRENT_USER\Control Panel\Mouse. To swap mouse buttons we need to set its value to 1.

Same thing can be done from command line using the below command.

reg add "HKEY_CURRENT_USER\Control Panel\Mouse" /v SwapMouseButtons /t REG_SZ /d 1

It requires a logoff or reboot to make the changes effective.

Reference Swap mouse buttons from command line:


Alternative Solution

How do I use Rundll32 to swapmousebutton? for a C# solution (requires the .NET Framework Runtime to be installed)