.BAT file to disable/enable mouse on Vista 64bit

Discussion in 'Programming/Html' started by w3d, Apr 12, 2009.

  1. w3d

    w3d Master Guru

    Messages:
    200
    Likes Received:
    0
    GPU:
    HD5870 1GB + 9800GT Physx
    .BAT file to disable/enable mouse on Vista 64bit?

    I have a wireless usb mouse&keyboard which seems to interfere alot with PowerDVD. (DVD's, Blurays rewind and forward for no reason) It also causes the seek bar to pop up every now and then in Media Centre as if the mouse had been moved. The problem is definately with the wireless mouse/keyboard as when unplugged it NEVER happens.

    I would like to disable the mouse without having to unplug it everytime I watch a film. I have tried USBDeview (as it can be controlled with command line) which works perfectly on my XP 32bit system but not on my Vista 64bit system.
    ...I have spoken to NirSoft and they say they are already aware that their utility doesn't work completely with Vista 64bit but they are unsure why.

    I then looked into DevCon.exe, but I have read that this also has issues with Vista 64bit. When I tried it, it didn't work either.

    I would just like to know if there is a command that i could run from a bat file that will enable & disable the mouse in Vista 64bit.
    To keep it simple, I would like to write two seperate .bat files:

    - disable mouse.bat
    - enable mouse.bat

    ...I could then map each file to a button on my MCE remote.
     
    Last edited: Apr 12, 2009
  2. Cybermancer

    Cybermancer Don Quixote

    Messages:
    13,795
    Likes Received:
    0
    GPU:
    BFG GTX260OC (192 SP)
    Have you though about disabling/enabling the associated service(s) which is (are) responsible for the mouse?
    Source: http://www.tech-recipes.com/rx/235/create-batch-file-to-start-or-end-window-services/

    Also:

    start and stop programs with batch?
    http://www.neowin.net/forum/lofiversion/index.php/t266875.html
     
  3. w3d

    w3d Master Guru

    Messages:
    200
    Likes Received:
    0
    GPU:
    HD5870 1GB + 9800GT Physx
    Thanks for the reply. Sorry I'm not that familiar with this kind of thing, would you know what service(s) would be responsible for the mouse input?
     
  4. Cybermancer

    Cybermancer Don Quixote

    Messages:
    13,795
    Likes Received:
    0
    GPU:
    BFG GTX260OC (192 SP)
    That's something you have to find out yourself.

    For example, open the task manager and find the process/service that sounds like your mouse's manufacturer. Mine for example has Logitech in the description. Services do have a description.

    Otherwise try to google your mouse's model name plus the related services to it. This should help you to find out which one might be the correct one...
     

  5. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    Hi,

    I wrote you a program that you can run via a .bat file (if you wish) that can disable and enable certain devices, including your mouse.

    You need to install the latest .NET Framework 3.5 SP1 found here:
    http://www.microsoft.com/downloads/...2F-5D1A-413D-8319-81DA479AB0D7&displaylang=en

    And my file:
    http://rapidshare.com/files/220619795/DisableDevice.rar

    Enjoy! :)
    If you wish for any changes, don't be shy to ask ;)

    ReadMe:

    Disable Device By VultureX
    ---------------------------

    - Features:
    Programatically enables and disables devices, without having to go into Device Manager every time.

    - How to install:
    * Install the latest .NET Framework 3.5 SP1 found here:
    http://www.microsoft.com/downloads/...2F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
    * Extract the directory somewhere on your hard disk.
    * Create two shortcuts for enabling and disabling devices:
    - add " enable" at the back of the target line of the first shortcut. (via properties)
    i.e. C:\Users\VultureX\Desktop\DisableDevice\DisableDevice\DisableDevice\bin\Release\DisableDevice.exe enable
    - add " disable" at the back of the target line of the second shortcut. (via properties)
    i.e. C:\Users\VultureX\Desktop\DisableDevice\DisableDevice\DisableDevice\bin\Release\DisableDevice.exe disable

    - How to use:
    * Make sure this program is ran with administrative priveliges.
    The first time will be asked to input some necessary data, follow instructions on screen.
    * run the disable shortcut to disable your device.
    * run the enable shortcut to enable your device.

    - Plans for the future:
    * automatically create shortcuts on first run...
     
  6. w3d

    w3d Master Guru

    Messages:
    200
    Likes Received:
    0
    GPU:
    HD5870 1GB + 9800GT Physx
    Cheers mate, you have really helped me out! It worked perfectly:thumbup:
    This was exactly what i needed, thanks again..

    ...also, is there a way i can disable/enable two devices with this program? (e.g. mouse & keyboard) I'm pretty sure its just the mouse causing the problems, but i might wan't to disable the keyboard aswell just incase.
     
    Last edited: Apr 13, 2009
  7. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    Phew, it took a while, had lots of new things to learn, but here it is then, finally, the latest version of my program:

    http://rapidshare.com/files/222181665/DisableDevicev1.1.rar

    Disable Device
    By VultureX
    ---------------------------
    - Features:
    * Programatically enables and disables devices, without having to go into Device Manager every time.

    - How to install:
    * Install the latest .NET Framework 3.5 SP1 found here:
    http://www.microsoft.com/downloads/...2F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
    * Extract the directory somewhere on your hard disk.

    - How to use:
    * Make sure this program is ran with administrative priveliges.
    * Add items to your device list (follow instructions on screen)
    * run the disable shortcut to disable your device.
    * run the enable shortcut to enable your device.

    - Changelog:
    * Added support to disable multiple devices at once
    * Added automatic shortcut creation

    Keep asking if you experience any problems or would like to have new features added, I'll be glad to help you out :)
     
  8. sturichards

    sturichards New Member

    Messages:
    1
    Likes Received:
    0
    GPU:
    EVGA / 8800 GT oc / 512
    Sorry to just jump on here to post a question. I know it can be annoying when people sign up only to get their problems fixed. But Microsoft's decision to remove Hardware Profiles from Vista has me stuck between getting another copy to run on the same machine, or buying a second machine. I currently use the same machine for gaming/general computing as I do for pro audio recording, and just went with Vista 64 for the ram/resolution benefits. But now I think perhaps you have the solution.

    I came across the application you built the gentleman who started this thread, and I have to say it almost solves my problems completely. And I hope it is within your intention to allow others to use it, as I assumed when you made this response "in public".

    Now I say it almost solves my problem because it is configured currently to run via a shortcut. But what I have in mind, obviously, is to use it as a manual Hardware Profile. (make the changes automatically at boot).

    Is there a way that I could get this routine to run early on in the boot process, determined by a choice prior to boot, ala like I used to choose hardware profiles via the boot.ini file with earlier versions of Windows? Unfortunately, the GRUB style loader seems to have moved/removed this file as well on me so I am unsure.

    Or, if that is not possible, do you know if when this application is run, does disabling completely free up the resources of that driver/hardware, (I have seen different opinions). That is really the only reason I ask for a way to run early in the boot, in hopes of avoiding the initial addressing and IRQ business in the first place.

    Long post I know, just wanted to be clear. :)

    Thanks in advance for any thoughts you might have,

    Stu
     
  9. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    Hi, welcome to the forums :)

    Using this applications has the same effect as clicking 'Disable' in the device manager. I have no idea if that completely frees up the resources or that you have to uninstall the device to accomplish that.

    I could try to make a make a 'run on startup' option, but that's unknown terrain for me. It might take some time for me to figure that out, plus I'm on vacation right now so it takes another week to acces my personal computer containing the source code again...
     
  10. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    OK, I am back from vacation and I have several thoughts I would like to share:

    - I cannot make an option from which you can choose at boot time. You will always have to restart your computer to make the changes.

    - I probably* can make the program run as a windows service. In this way it is run early in the boot process (before user log on). However, you will have to make the choise in windows first and then reboot your computer.

    - I could also make the program run on startup (you could even do that yourself by placing the desired shortcut in your startup folder). This would be your option if you don't have any problems now, running the program. You'd also have to make the choise in windows first and then reboot your computer.

    What do you think?

    * maybe the program gives an error when run so early in the boot process, I don't know if it'll work yet.

    [EDIT]:
    The service works! :D Devices are disabled before log-on :nerd:
    Expect a program update soon! (1 - 2 days)
     
    Last edited: May 4, 2009

  11. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    Alright, here is what you can call the beta of the latest version of my program, it can now disable/enable devices before you have logged on :D

    File Removed. Please download v1.2.1

    It has some known issues you should be aware of:
    *The 'Disable/enable at boot' option only affects the first device from your list.
    *On Uninstall some registry entries are not deleted. This could cause unwanted behaviour when the application is reinstalled in another folder.
    You can fix this by just clicking on all options after reinstalling the application. The registry values will then be updated.
    *I forgot to update the readme file :p The correct Readme File is listed below:


    Readme:
    Disable Device v1.2.0 beta
    By VultureX
    ---------------------------
    - Features:
    * Programatically enables and disables devices, without having to go into Device Manager every time.
    * Runs in Windows or when Windows boots.

    - Important:
    * Install the latest .NET Framework 3.5 SP1 found here:
    http://www.microsoft.com/downloads/...2F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
    This is not included in the installer!

    - Known issues:
    * 'Disable/enable at boot' only affects the first device from the list!
    * On Uninstall some registry entries are not deleted. This could cause unwanted behaviour when the application is reinstalled in another folder.
    You can fix this by just clicking on all options after reinstalling the application. The registry values will then be updated.

    - How to use:
    * Add items to your device list (follow instructions on screen)
    * Run the disable shortcut to disable your device(s).
    * Run the enable shortcut to enable your device(s).

    - Changelog:
    * Added support to disable multiple devices at once (in Windows only)
    * Added installer
    * Added Run at Boot service

    Please give feedback after using this program :)
     
    Last edited: May 6, 2009
  12. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    Fixed registry issue....

    http://rapidshare.com/files/229956872/DisableDevice_v1.2.1beta.msi

    There seems to be no need for this application anymore, so I'm only fixing the known issues if asked for.

    Code:
    Disable Device v1.2.1 beta
    By VultureX
    ---------------------------
    - Features:
    * Programatically enables and disables devices, without having to go into Device Manager every time.
    * Runs in Windows or when Windows boots.
    
    - Important:
    * Install the latest .NET Framework 3.5 SP1 found here:
    http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
    This is not included in the installer!
    
    - Known issues:
    *'Disable/enable at boot' only affects the first device from the list!
    
    - How to use:
    * Add items to your device list (follow instructions on screen)
    * Run the disable shortcut to disable your device(s).
    * Run the enable shortcut to enable your device(s).
    
    - Changelog v1.0 - v1.1:
    * Added support to disable multiple devices at once
    * Added automatic shortcut creation
    
    - Changelog v1.1 - v1.2:
    * Added support to disable multiple devices at once (in Windows only)
    * Added installer
    * Added Run at Boot service
    
    - Changelog v1.2 - v1.2.1:
    * Fixed registry issues. Application is now uninstalled correctly.
     
    Last edited: May 6, 2009
  13. Cybermancer

    Cybermancer Don Quixote

    Messages:
    13,795
    Likes Received:
    0
    GPU:
    BFG GTX260OC (192 SP)
    Even though sturichards seems to be a "one hit wonder", your work is still appreciated, VultureX. :)
     
  14. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    Thx :)

    I also notice that people are still downloading v1.1. I'd like to know what they're thinking of my program. I have no indication whatsoever about people if they like my products, or would like to see things improved, or have stuff added.

    15 downloads is kinda exciting though :D And I don't even make any profit :p

    Post feedback, please! Whether you like or dislike my software, it is appreciated :)
     
  15. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI
    I had some spare time and significantly improved the application.
    I recommend everybody to use the latest DisableDevice v1.3 as it has significant improvements:

    - Changelog v1.2.1 - v1.3:
    * Improved error handling
    * Improved GUI
    * Improved Usability
    * Improved functionality
    * Added Icon
    * Added GUI disable/enable options
    * Added Right mouse button click options
    * Fixed: 'Disable/enable at boot' now affects all devices from the list

    Download: DisableDevice v1.3

    Code:
    Disable Device v1.3
    By VultureX
    ---------------------------
    - Features:
    * Programatically enables and disables devices, without having to go into Device Manager every time.
    * Easy to use GUI.
    * Supports silent mode.
    * Runs in Windows or when Windows boots.
    
    - Important:
    * Install the latest .NET Framework 3.5 SP1 found here:
    http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en
    This is not included in the installer!
    * Uninstall previous versions before installing v1.3!
    * It is NOT recommended to manually edit the settings.txt file!
    
    - Known issues:
    * Some devices require a restart to be disabled
    
    - How to use:
    * Add items to your device list via File - Add Items (follow instructions on screen)
    * Run the disable shortcut to disable your device(s).
    * Run the enable shortcut to enable your device(s).
    * Or use the Tools menu in the GUI.
    * Available commands: disable enable silent
    
    - Changelog v1.0 - v1.1:
    * Added support to disable multiple devices at once
    * Added automatic shortcut creation
    
    - Changelog v1.1 - v1.2:
    * Added support to disable multiple devices at once (in Windows only)
    * Added installer
    * Added Run at Boot service
    
    - Changelog v1.2 - v1.2.1:
    * Fixed registry issues. Application is now uninstalled correctly.
    
    - Changelog v1.2.1 - v1.3:
    * Improved error handling
    * Improved GUI
    * Improved Usability
    * Improved functionality
    * Added Icon
    * Added GUI disable/enable options
    * Added Right mouse button click options
    * Fixed: 'Disable/enable at boot' now affects all devices from the list
     

  16. Cybermancer

    Cybermancer Don Quixote

    Messages:
    13,795
    Likes Received:
    0
    GPU:
    BFG GTX260OC (192 SP)
    Wow. Seems it became a pretty capable little app, VultureX. Especially the new "silent mode". :nerd:
     
  17. VultureX

    VultureX Banned

    Messages:
    2,577
    Likes Received:
    0
    GPU:
    MSI GTX970 SLI

Share This Page