Drives & Partitions

Enumerate

wmic logicaldisk get name

Lists all drives using WMIC.

fsutil fsinfo drives

Displays drives using FSUtil utility.

Get-PSDrive

Lists drives in PowerShell.

net use

Shows network-mapped drives.

bcdedit /enum all

Lists drives in boot configuration data.

View Drives on machine (includes mapped drives):

Get-WmiObject -Class Win32_LogicalDisk
Get-WmiObject -Class Win32_LogicalDisk -Filter “DriveType=3”

Modify

format <DriveLetter>: /FS:<FileSystem>

Formats a drive with the specified file system (e.g., NTFS, FAT32).

label <DriveLetter>: <NewLabel>

Assigns a new label to a drive.

subst <DriveLetter>: <Path>

Creates a virtual drive that is mapped to a specified folder path.

subst <DriveLetter>: /D

Deletes a previously created virtual drive.

Get-Disk

Retrieves disk information.

Initialize-Disk -Number <DiskNumber>

Initializes a disk, preparing it for use.

New-Partition -DiskNumber <DiskNumber> -UseMaximumSize -AssignDriveLetter

Creates a new partition on a disk and assigns a drive letter.

Format-Volume -DriveLetter <DriveLetter> -FileSystem <FileSystem>

Formats a volume with the specified file system.

Set-Partition -DriveLetter <DriveLetter> -NewDriveLetter <NewDriveLetter>

Changes the drive letter of a partition.

Remove-Partition -DriveLetter <DriveLetter>

Removes a partition from a disk.

DiskPart Commands

diskpart

Launches the DiskPart command-line tool for disk management tasks.

list disk

Displays a list of disks.

select disk <DiskNumber>

Selects a disk for subsequent operations.

clean

Removes all partitions and data from the selected disk.

create partition primary

Creates a primary partition on the selected disk.

format fs=<FileSystem> quick

Formats the selected partition with the specified file system.

assign letter=<DriveLetter>

Assigns a drive letter to the selected partition.

remove letter=<DriveLetter>

Removes the drive letter from the selected partition.

Registry Locations

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

Contains settings and configurations related to the filesystem, including NTFS-specific settings, file system performance tweaks, and other file system behavior settings.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares

Stores information about shared folders on the system, including the path, share name, and share properties.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Contains information about user profiles on the system, including the location of user-specific directories and files.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches

Contains settings for disk cleanup of various types of files and data stored on the filesystem.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ntfs

Contains settings specific to the NTFS file system, such as performance optimizations and security settings.

Last updated

Was this helpful?