Can I block certain process from accessing certain USB device?

Page 1 of 2 12 LastLast

  1. Posts : 33
    win 10 pro 64-bit
       #1

    Can I block certain process from accessing certain USB device?


    Hiya, i need to do a very specific thing, i hope someone here can help. i first explain what the issue is: i have USB controller plugged into PC, but one game i play automatically defaults to a controller and as result, game is unplayable (menus dont work, all the button prompts are for controller ..etc).
    so i want to simply disable controller access for this specific game, is this possible?

    YES unplugging the controller works, but i dont feel like crawling under my table behind my PC every time i want to play this game. i currently play 2 main games and i need controller in one of them. furthermore if i would unplug and forget to re-plug the controller before playing the other game that needs it, then as result that game will reset my controls!

    isn't there some kind of a tool or method in windows to just block that specific game from even seeing that i have controller plugged in? i have asked game devs to fix this, but they dont care. its been like 2 years and i have reported that bug at least 4-5 times and they just dont care

    it would be greatly appreciated if someone here has solution other than yanking out the cable each time. thanks.
      My Computer


  2. Posts : 43,279
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, here's an idea:

    Create a small (2 or 3 line) script file to
    a. disable the USB port the unwanted controller is connected to
    b. launch your game

    Always use a shortcut to that script to launch your game.

    Suitable scripting language: Autohotkey (free).
    Or you could write a bat file.

    Possible tool to use in that script to disable a specific device/port:
    Disable / enable USB device from command-line on Windows

    Note: you need to arrange to re-enable the port/device:

    E.g. have a loop running at the end of that script which includes

    If game no longer running (process not present) then
    Enable USB port
    Exit script
      My Computers


  3. Posts : 33
    win 10 pro 64-bit
    Thread Starter
       #3

    thanks. looks like it will do the job. i'll give it a go when i have a moment to set it up. i wouldn't go as far as making checks for when game is running. if i can just have 2x .bat files, one to turn controller off and other to on, that's good enough. i just dont feel like yanking it out every time i want to play.
      My Computer


  4. Posts : 43,279
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    hope it works out..
      My Computers


  5. Posts : 5,025
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #5
      My Computer


  6. Posts : 2,800
    Windows 7 Pro
       #6

    You can also use DevCon

    Use to find your device:
    Code:
    devcon find USB*
    Disable USB device:
    Code:
    devcon disable "USB\VID_xxxx&PID_yyyy"
    Enable USB device:
    Code:
    devcon enable "USB\VID_xxxx&PID_yyyy"
    So you can do something like
    Code:
    devcon disable "USB\VID_xxxx&PID_yyyy"
    Start /wait "your game here"
    devcon enable "USB\VID_xxxx&PID_yyyy"
    The little downfall is the cmd has to run with elevated privilege for the "Disable / Enable" command to work.
      My Computers


  7. Posts : 1,848
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #7

    MaloK said:
    The little downfall is the cmd has to run with elevated privilege for the "Disable / Enable" command to work.
    In my experience both USBDeview and Devcon work well.

    A big downfall IMO of devcon.exe is that it isn't built-in to Windows. Have a look at the Microsoft documentation for more info, including vague directions how to get it.

    Just be aware of two things:

    1. You need the Windows Driver Kit (WDK) for the version of Windows that you're using. (See this Microsoft doc for versions.)

    2. You'll be downloading/installing a 600MB+ WDK in order to extract the tiny (by comparison) devcon.exe file.

    For example, for Windows 10 2004 you first download a 1.3MB wdksetup.exe file which acts as a downloader shim to pull down the rest of the WDK. Next you extract/install the WDK then finally you navigate the WDK file structure to find %WindowsSdkDir%\tools\x64\devcon.exe. Once you've found it, I suggest you copy it to the C:\Windows\System32\ folder so you don't get any PATH issues. You can then uninstall the WDK.

    I'd try USBDeview first...
      My Computer


  8. Posts : 43,279
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #8

    The little downfall is the cmd has to run with elevated privilege for the "Disable / Enable" command to work.
    Have you considered creating an elevated shortcut?

    Create Elevated Shortcut without UAC prompt in Windows 10

    - from the huge searchable Tutorial section...
      My Computers


  9. Posts : 2,800
    Windows 7 Pro
       #9

    RickC said:
    In my experience both USBDeview and Devcon work well.

    A big downfall IMO of devcon.exe is that it isn't built-in to Windows. Have a look at the Microsoft documentation for more info, including vague directions how to get it.

    Just be aware of two things:

    1. You need the Windows Driver Kit (WDK) for the version of Windows that you're using. (See this Microsoft doc for versions.)

    2. You'll be downloading/installing a 600MB+ WDK in order to extract the tiny (by comparison) devcon.exe file.

    For example, for Windows 10 2004 you first download a 1.3MB wdksetup.exe file which acts as a downloader shim to pull down the rest of the WDK. Next you extract/install the WDK then finally you navigate the WDK file structure to find %WindowsSdkDir%\tools\x64\devcon.exe. Once you've found it, I suggest you copy it to the C:\Windows\System32\ folder so you don't get any PATH issues. You can then uninstall the WDK.

    I'd try USBDeview first...
    You can use GWT.exe to download only the WAIK component you want

    083 – DOWNLOAD IMAGEX, BCDBOOT AND OTHER WAIK TOOLS AND MICROSOFT BINARY FILES – RMPrepUSB

    But yeah, it will fire up Defender when you want to use it, loll, (of course it's a false positive, this tool has been used millions of times.

    dalchina said:
    Have you considered creating an elevated shortcut?

    Create Elevated Shortcut without UAC prompt in Windows 10

    - from the huge searchable Tutorial section...
    Yes, but since it's not in the scope of the thread, I didn't expand on this. Thanks
      My Computers


  10. Posts : 1,848
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #10

    MaloK said:
    You can use GWT.exe to download only the WAIK component you want

    083 – DOWNLOAD IMAGEX, BCDBOOT AND OTHER WAIK TOOLS AND MICROSOFT BINARY FILES – RMPrepUSB

    But yeah, it will fire up Defender when you want to use it, loll, (of course it's a false positive, this tool has been used millions of times.
    Never heard of GWT before. Many thanks... good info.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:27.
Find Us




Windows 10 Forums