I am trying to use the following script to adjust the mouse sensativity - we
want to include this on the desktop of all the laptops in the org so while
attached to the dockingstation w/ a external mouse the mouse sensativity is
20 - and when on the road a simple click will turn it down to 1, making the
mouse pointer easier to control..

Using regmon the only key that needs to be changed is MouseSensitivity; and
doing it via the cpl applet changes the key and immediatly adjusts the
sensativity.

I wrote the following script and it does change the key but a reboot is
required to commit the change - can someone point me in the direction that
will make the setting take effect when set in the script?



Set WSHShell = WScript.CreateObject("WScript.Shell")
RegKey = "HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity"
WSHShell.RegWrite RegKey,"1","REG_SZ"
WScript.Quit

Thanks
David

Re: Help with Registry Modification by Torgeir

Torgeir
Fri Jul 16 08:12:08 CDT 2004

David Doumani wrote:

> I am trying to use the following script to adjust the mouse sensativity - we
> want to include this on the desktop of all the laptops in the org so while
> attached to the dockingstation w/ a external mouse the mouse sensativity is
> 20 - and when on the road a simple click will turn it down to 1, making the
> mouse pointer easier to control..
>
> Using regmon the only key that needs to be changed is MouseSensitivity; and
> doing it via the cpl applet changes the key and immediatly adjusts the
> sensativity.
>
> I wrote the following script and it does change the key but a reboot is
> required to commit the change - can someone point me in the direction that
> will make the setting take effect when set in the script?
>
>
>
> Set WSHShell = WScript.CreateObject("WScript.Shell")
> RegKey = "HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity"
> WSHShell.RegWrite RegKey,"1","REG_SZ"


For Win2k and WinXP, this might work:

WSHShell.Run _
"%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", _
1, True


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Re: Help with Registry Modification by David

David
Fri Jul 16 11:24:34 CDT 2004

Thanks for the input. I tried that and it doesnt seem to work either. I
ensured that the syntax was correct and launched notepad to ensure the shell
was working... still no update to the mouse sensativity until a reboot. Any
other ideas?

Set WSHShell = WScript.CreateObject("WScript.Shell")
RegKey = "HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity"
WSHShell.RegWrite RegKey,"20","REG_SZ"
WSHShell.Run "%windir%\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters",1, True
WScript.Quit


"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:umYkqazaEHA.3480@TK2MSFTNGP11.phx.gbl...
> David Doumani wrote:
>
> > I am trying to use the following script to adjust the mouse
sensativity - we
> > want to include this on the desktop of all the laptops in the org so
while
> > attached to the dockingstation w/ a external mouse the mouse sensativity
is
> > 20 - and when on the road a simple click will turn it down to 1, making
the
> > mouse pointer easier to control..
> >
> > Using regmon the only key that needs to be changed is MouseSensitivity;
and
> > doing it via the cpl applet changes the key and immediatly adjusts the
> > sensativity.
> >
> > I wrote the following script and it does change the key but a reboot is
> > required to commit the change - can someone point me in the direction
that
> > will make the setting take effect when set in the script?
> >
> >
> >
> > Set WSHShell = WScript.CreateObject("WScript.Shell")
> > RegKey = "HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity"
> > WSHShell.RegWrite RegKey,"1","REG_SZ"
>
>
> For Win2k and WinXP, this might work:
>
> WSHShell.Run _
> "%windir%\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters", _
> 1, True
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/community/scriptcenter/default.mspx



Re: Help with Registry Modification by Torgeir

Torgeir
Fri Jul 16 12:37:21 CDT 2004

David Doumani wrote:

> Thanks for the input. I tried that and it doesnt seem to work either. I
> ensured that the syntax was correct and launched notepad to ensure the shell
> was working... still no update to the mouse sensativity until a reboot. Any
> other ideas?
>
> Set WSHShell = WScript.CreateObject("WScript.Shell")
> RegKey = "HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity"
> WSHShell.RegWrite RegKey,"20","REG_SZ"
> WSHShell.Run "%windir%\System32\RUNDLL32.EXE
> user32.dll,UpdatePerUserSystemParameters",1, True
> WScript.Quit
Hi

If you don't want to use SendKeys, you can at least make it easier
for the user by launching the Mouse applet for the user, and then
let the user do the rest:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

oShell.Run "control.exe main.cpl,Mouse", 1, False
'--------------------8<----------------------



If you want to use SendKeys, here is a script that sets
MouseSensitivity to 20:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")

oShell.Run "control.exe main.cpl,Mouse", 1, False

Do While Not oShell.AppActivate("Mouse Properties")
WScript.Sleep 50
Loop

WScript.Sleep 200
oShell.SendKeys "+{TAB}{RIGHT}{RIGHT}{TAB}{END}~"
'--------------------8<----------------------


To set MouseSensitivity to 1, substitute {END} with {HOME} in
the SendKeys statement above.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Re: Help with Registry Modification by Fosco

Fosco
Fri Jul 16 23:48:36 CDT 2004

"David Doumani"

try this (NOT sure if ...)

set oShell = CreateObject("WScript.Shell")
oShell.run"C:\WINDOWS\RUNDLL.EXE user,RepaintScreen"

--
Fosco