Why Stop Windows from Auto-Mounting Drives?
By default, whenever you plug a USB flash drive, an external HDD, or an SD card into a Windows 10 PC, the operating system instantly mounts the file system, assigns it a drive letter (like D: or E:), and makes the contents fully accessible. It also frequently auto-runs certain background indexing services on that drive.
While this is standard plug-and-play behavior, it can be a massive security vulnerability in a corporate environment. If a malicious USB drive is inserted, it mounts immediately before the user can even react. Additionally, for IT professionals running data recovery or digital forensics, auto-mounting a failing drive can write temporary metadata to it, destroying evidence or worsening hardware corruption. You can disable this automatic mounting to ensure drives remain offline until you explicitly request them.
How to Disable Auto-Mounting in Windows 10
To stop Windows from automatically assigning drive letters and mounting volumes, you must use the built-in DiskPart command-line utility.
- Click the Start button, type cmd, and wait for the “Command Prompt” app to appear in the search results.
- Right-click on “Command Prompt” and select Run as administrator.
- In the black terminal window, type the following command to launch the disk partition utility:
diskpart
- Press Enter. Your prompt will change to
DISKPART>. - Type the following command to disable automatic mounting:
automount disable
- Press Enter. You should see a confirmation message stating: Automatic mounting of new volumes disabled.
- Type
exitand press Enter to leave DiskPart, and then close the command prompt window.
From this point forward, when you plug in a new USB drive, it will not appear in “This PC.” You must open the Disk Management utility (diskmgmt.msc), right-click the unassigned drive, and manually select “Change Drive Letter and Paths” to access your files.