2

Is it possible to control Left-handed Mouse settings via GPO? (or a script that can be pushed using GPO :)

I have Windows 7 / Windows Server 2008.

Many thanks for your advice.

Toast

chicks
  • 3,639
  • 10
  • 26
  • 36
ToastMan
  • 544
  • 4
  • 18
  • 29

3 Answers3

6

Yes, it can be done.

Group Policies -> User Configuration -> Preferences -> Windows Setting

Go to the 'Registry' setting.

Add a new Registry setting.

[HKEY_CURRENT_USER\Control Panel\Mouse]
SwapMouseButtons (RegSZ) = 1
sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
4

I realize you already accepted an answer, but here's a VBS version of it for you as well (cause I know you were kind of looking for that):

Const HKEY_CURRENT_USER = &H80000001 
strComputer = "."  
Set Shell = CreateObject("WScript.Shell")  

Set objRegistry = GetObject ("winmgmts:\\" & strComputer & "\root\default:StdRegProv")  
strKeyPath = "Control Panel\Mouse"  

strValueName = "SwapMouseButtons"
strValue = "1"
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue

Just be aware that these settings won't take affect until the next time the user logs in (after it's been applied), and also be aware that things like Logitech's MouseWare and SetPoint will often just switch that registry setting back (until you set it in their mouse-specific software) once they load after logon.

techie007
  • 1,892
  • 17
  • 24
  • Ah ha! Now that's exactly what I needed :) Thanks again techie007, that's the second mouse problem u help me with :P – ToastMan Feb 03 '10 at 19:06
-1

This is the answer as it swap to left handed then click again and it swaps back. The SwapMouseButtons only goes to left handed but not back.

Change between left and right handed and back with one script - click once it changes then click again and it changes it back vs. the RUNDLL32.EXE USER32.DLL,SwapMouseButton which only swaps to left hand but not back .

Note: if you want to email this file after you create this into MouseHandSwitch.vbs copy the following script and save it as a .vbs file on desktop and now you get it.

'> Mouse change Left to Right handed.
'>           and repeat to set Left to Right handed again.
'>    By William Anderson  July 17, 2015

Sub DoAction(str, ms)
    '> Check status until ready
    status = (WshShell.AppActivate)(cPanel.ProcessID)

    Do Until status = true
        WScript.Sleep 100
        status = (WshShell.AppActivate)(cPanel.ProcessID)
        WScript.Sleep 100
    Loop

    if status = true then
        WshShell.SendKeys str
        WScript.Sleep ms
    End if
End Sub

'> Set windows for best performance
Set WshShell = CreateObject("WScript.Shell")
Set cPanel = WshShell.Exec("rundll32.exe shell32.dll,Control_RunDLL main.cpl")
status = (WshShell.AppActivate)(cPanel.ProcessID)

Do Until status = true
    WScript.Sleep 100
    status = (WshShell.AppActivate)(cPanel.ProcessID)
    WScript.Sleep 100
Loop

if status = true then
'> Send alt S to mouse panel
    DoAction "%S", 20 
    DoAction "{ENTER}", 20
End if