My eight-year-old son is left-handed and I am right-handed. I wish to be able to quickly and easily switch primary and secondary mouse buttons from the command line. We use Windows 10. I found this(link is external), which provides c and C#* solutions. I found this(link is external) which provides a solution which does require rebooting, and also provides a link to the Stack Overflow answer. However, it seems to me that this should be possible to do without resorting to a compiled language. I would be happy with a solution using PowerShell, Python, Perl, a nircmd(link is external) utility, etc., but I'd rather not resort to a compiled language.

Thank you for your help.

Edit: Changed question to add "...or by using a hotkey...", since I ultimately wanted to do this with an Autohotkey hotkey; it turns out that Autohotkey can do the swap itself. I was assuming that the answer would be e.g. a Powershell script, which I would invoke by using an Autohotkey hotkey. See the accepted answer.