Exit Posted May 18, 2014 Share Posted May 18, 2014 (edited) My optical USB mouse sometimes refuses to work . Plug out / plug in the USB connector heals the problem. Since my PC is located below the desk, it takes some sportive moments to do health care. I looked for a better solution and found that invoking system control panel for mouse and then deact/act the driver did the job. So I've written a small script to do it for me: ;;~ reset mouse (does NOT work) ShellExecute("main.cpl",",4") WinWaitActive("[class:#32770]","",3) Sleep(1000) ControlClick("[class:#32770]","","Button2") Sleep(1000) ControlSend("[active]","", "","^{TAB}") Sleep(1000) ControlClick("[active]","","Button4") Sleep(1000) ControlSend("[active]","", "","{TAB}") Sleep(5000) ; to check that selction before ENTER ControlSend("[active]","", "","{ENTER}") MsgBox(Default, Default, "Just try it yourself now ",3) The dialog shows the same panels as the 'by hand' method. But the click on the 'deactivate' and 'confirn' buttons have no effect. Strange. How to disable and enable the mouse driver by a script ? Edited May 19, 2014 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Gianni Posted May 19, 2014 Share Posted May 19, 2014 (edited) if the use of a little "external" utility is allowed then maybe you could use DevCon as explained here .....else forget this post Edited May 19, 2014 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Unc3nZureD Posted May 19, 2014 Share Posted May 19, 2014 I don't know if you've already tried, but sometimes automatisation requires admin rights. Try #RequireAdmin Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Author Share Posted May 19, 2014 if the use of a little "external" utility is allowed then maybe you could use DevCon as explained here .....else forget this post I tried DevCon.exe already with no success. But nevertheless, thanks for your effort. I don't know if you've already tried, but sometimes automatisation requires admin rights. Try #RequireAdmin #RequireAdmin was also unrewarding. Again, thanks for your effort. @ALL: Did you tried my code on your PC ? Same findings ? App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Terenz Posted May 19, 2014 Share Posted May 19, 2014 Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Author Share Posted May 19, 2014 (edited) Can you give me please the download link of your devcon_x64.exe. Or send it via PM. Thanks Here the log on my PC: Edited May 19, 2014 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Terenz Posted May 19, 2014 Share Posted May 19, 2014 (edited) If you have a x64 system you can't use the x86 version, it will not work. PM sent, the official way is to download the entire Windows Developer Kit for a couple of KB Oh, and don't forget to run CMD as administrator Edited May 19, 2014 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Author Share Posted May 19, 2014 If you have a x64 system you can't use the x86 version, it will not work. PM sent, the official way is to download the entire Windows Developer Kit for a couple of KB Oh, and don't forget to run CMD as administrator Many thanks. Your PM'ed version works like a charm. In the meantime I already downloaded and installed WDK. I'll browse it and probably discard it soon. But there is a question left: Why does my script does not work ? Any thoughts? App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Unc3nZureD Posted May 19, 2014 Share Posted May 19, 2014 I might see your problem There are tons of [class:#32770] running on a windows machine. It's a common class, you need something unique. Try to replace it with the actual title. I think it should work. Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Author Share Posted May 19, 2014 (edited) I might see your problem There are tons of [class:#32770] running on a windows machine. It's a common class, you need something unique. Try to replace it with the actual title. I think it should work. As you can see from the screenshot, it is no problem with [class:#32770] Did you run the script? Edited May 19, 2014 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Author Share Posted May 19, 2014 This script now makes the job: ;~ reset mouse RunWait('"' & @ComSpec & '" /c ' &@UserProfileDir& '\Data\Software\DevCon\devcon\devcon_x64\devcon.exe disable *mouse*', '', @SW_HIDE) RunWait('"' & @ComSpec & '" /c ' &@UserProfileDir& '\Data\Software\DevCon\devcon\devcon_x64\devcon.exe enable *mouse*', '', @SW_HIDE) But the script from first post refuses to do the job. Strange ! App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Solution jguinch Posted May 19, 2014 Solution Share Posted May 19, 2014 But the script from first post refuses to do the job. Strange ! Probably because you ran your script in x86 mode. Try with x64. Exit 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Exit Posted May 19, 2014 Author Share Posted May 19, 2014 Probably because you ran your script in x86 mode. Try with x64. Bingo ..... The x64 version did the trick. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now