Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExternalDiskKit

A Windows tool for USB / SD / MMC sticks only. It lists removable disks, tells you if they are healthy, repairs them when it can, and formats them when you ask.

It will not touch the Windows system disk. Internal drives (NVMe, SATA, and friends) stay hidden unless you deliberately override that.

ExternalDiskKit window

What it is

A safer stand-in for raw diskpart when you just need to:

  • See what is plugged in
  • Check whether a stick is dirty, locked, or empty
  • Repair it so it is actually usable
  • Wipe and format it (NTFS or exFAT)
  • Eject it

There is a mouse-first GUI (double-click run.cmd) and a PowerShell CLI that share the same engine.

What it is not

  • Not TestDisk or any kind of data recovery
  • Not a boot-record / MBR rebuild tool
  • Not an in-place MBR ↔ GPT converter that keeps your files
  • Not for RAID, dynamic disks, or imaging ISOs onto a stick
  • Not a password tool for BitLocker (unlock in Windows first)

Back up anything you care about before you format or erase.

Requirements

  • Windows 10 or 11
  • Administrator (the launchers will ask)
  • Windows PowerShell 5.1 (built in) — PowerShell 7 on Windows is fine too
  • No extra modules to install

Quick start (GUI)

  1. Clone this repo, or download the ZIP and unpack it.
  2. Double-click run.cmd.
  3. Allow Administrator.
  4. Plug in a USB stick if one is not already listed.
  5. Click the disk card, then Diagnose. A healthy formatted stick should say ready to use.
  6. To wipe it: Format disk... → pick NTFS or exFAT → Format diskConfirm.
  7. Eject when you are done.

Format and Erase use Confirm / Cancel. The box names the disk (number, serial, size, bus) and lists what will run. Cancel aborts.

Recommended filesystem: exFAT if the stick is 32 GB or larger and you want Mac + PC; NTFS for Windows-only / backups.

How it works

run.cmd  →  ExternalDiskKit.Gui.ps1   (WPF window, mouse)
run-cli.cmd  →  ExternalDiskKit.ps1   (same engine, terminal)
You click What actually runs
Diagnose Dirty-bit check, BitLocker status, write-protect clues. USB live scans are unreliable, so a snapshot error is not treated as “needs chkdsk”. If the volume is really dirty, an offline repair runs automatically.
Repair Online the disk if needed, then Repair-Volume -OfflineScanAndFix (NTFS) or chkdsk /F /X.
Format Optional Clear-Disk if partitions exist, then initialize/convert the table, New-Partition, Format-Volume, then an offline repair so the stick is ready to use.
Erase table Clear-Disk -RemoveData -RemoveOEM — blank stick, no filesystem.
Eject Asks Windows to eject, then offlines the disk.

Safety checks on every write:

  1. Never the Windows system / boot / pagefile disk
  2. Removable bus only by default (USB, SD, MMC, 1394, FileBackedVirtual)
  3. Identity is number + serial + size + name, not disk number alone
  4. BitLocker-locked volumes refuse format/erase until you unlock them in Windows
  5. Preview of the cmdlets before Confirm

Logs go to %TEMP%\ExternalDiskKit-yyyyMMdd-HHmmss.log.

CLI

Same rules, no window.

# From an elevated PowerShell
cd path\to\ExternalDiskKit
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

.\ExternalDiskKit.ps1                          # list removable disks
.\ExternalDiskKit.ps1 -DiskNumber 2 -Diagnose
.\ExternalDiskKit.ps1 -DiskNumber 2 -Repair
.\ExternalDiskKit.ps1 -DiskNumber 2 -Initialize -CreatePartition -Format NTFS -Label BACKUP -WhatIf
.\ExternalDiskKit.ps1 -DiskNumber 2 -Initialize -CreatePartition -Format NTFS -Label BACKUP
.\ExternalDiskKit.ps1 -DiskNumber 2 -Clean     # type DELETE to confirm
.\ExternalDiskKit.ps1 -SelfTest
Get-Help .\ExternalDiskKit.ps1 -Full

Or double-click run-cli.cmd.

CLI wipe/format/clean asks you to type DELETE. -WhatIf prints the cmdlets and changes nothing. Empty inventory (no USB plugged in) exits 0.

Exit Meaning
0 OK
2 No matching disk
3 Safety refused
4 You aborted
5 A cmdlet failed

Dangerous override (still never the OS disk): -AllowInternalDisks -Force and the full serial.

Files

File Role
run.cmd Elevate and open the GUI
run-cli.cmd Elevate and open the CLI
ExternalDiskKit.Gui.ps1 WPF UI
ExternalDiskKit.ps1 Engine + CLI
LICENSE MIT

License

MIT. See LICENSE.

About

Safer Windows tool to inventory, diagnose, repair, and format USB/SD disks. GUI + PowerShell 5.1. Refuses the system disk.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages