On Windows 10, if you keep getting the “Please insert a disk into USB drive” message trying to access your USB flash drive, or the “Windows was unable to complete the format” message when trying to reformat the drive, chances are the drive has corrupted data or something else went wrong.
In these scenarios, cleaning the drive completely and creating a new partition with the correct settings are likely to fix the problem. On Windows 10, you can quickly fix this problem with your USB flash drive, SD card, or another removable drive using a few PowerShell commands.
In this guide, you will learn the steps to use PowerShell commands to repair any USB flash drive that is not accessible, and as a result, you can’t reformat it on Windows 10.
Repair USB flash drive from PowerShell on Windows 10
To repair a USB flash drive with PowerShell commands on Windows 10, use these steps:
Open Start on Windows 10.
Search for PowerShell, right-click the result, and select the Run as administrator option.
Type the following command to identify the removable drive you want to repair and press Enter:
Type the following command to erase the drive and press Enter:
Get-Disk 6 | Clear-Disk -RemoveData
In the above command, make sure to change “6” to the disk number of the drive you want to repair. If you specify the number incorrectly, you could wipe out the wrong drive causing data loss.
Type Y to confirm that you want to wipe the specified drive and press Enter.
Type the following command to create a new partition using the NTFS file system and assign a name for the USB drive, and press Enter:
New-Partition -DiskNumber 6 -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel myUSB
In the above command, make sure to change “6” with the disk number of the drive you want to repair and change “myUSB” with the name you want to use for the storage.
Type the following command to assign a drive letter to the USB drive and press Enter:
Get-Partition -DiskNumber 6 | Set-Partition -NewDriveLetter G
In the above command, make sure to change “6” to the disk number of the drive you want to repair and change “G” to the letter you want to assign to the storage.
Once you complete the steps, open File Explorer and navigate to “This PC,” and you should now be able to access and store data on the removable drive.