Skip to content

Instantly share code, notes, and snippets.

@atodev
Created February 12, 2026 04:53
Show Gist options
  • Select an option

  • Save atodev/5e0b1ac6d2918664aa2aa9f35a4312be to your computer and use it in GitHub Desktop.

Select an option

Save atodev/5e0b1ac6d2918664aa2aa9f35a4312be to your computer and use it in GitHub Desktop.
USB
Open Command Prompt as an administrator.
Open Diskpart: Type diskpart and press Enter.
List all disks: Type list disk and press Enter. Carefully identify your USB drive by its size to avoid selecting the wrong disk (e.g., your main hard drive).
Select your disk: Type select disk X (replace X with the disk number of your USB drive) and press Enter.
Clean the drive: Type clean and press Enter. This command removes all partition data from the drive.
Create a new partition: Type create partition primary and press Enter.
Format the partition: Type format fs=ntfs quick (or format fs=fat32 quick for smaller or older drives) and press Enter. This performs a quick format with the specified file system.
Assign a drive letter: Type assign and press Enter to automatically assign an available drive letter, or type assign letter=Z (replace Z with your desired letter).
Exit Diskpart: Type exit and press Enter. Your USB drive should now be accessible and working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment