Enable USB port through Powershell script

Henk van Ingen 0 Reputation points
2024-09-20T11:01:59.4966667+00:00

Enable USB port through Powershell script
Settings in Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR detected

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,552 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 24,630 Reputation points MVP
    2024-09-20T11:32:25.3033333+00:00

    Use the following

    $usbStorRegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\USBSTOR"
    # Set the Start value to 3 (which enables the USB ports)
    Set-ItemProperty -Path $usbStorRegPath -Name "Start" -Value 3
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.