How can I export entire HDD filenames to csv/Excel


lbeck

Well-known member
Member
Local time
5:03 AM
Posts
72
OS
Windows 11
I have 10-15 TB of data on several HDD/SSDs. Because of some terrible misfortune I’ve lost many important files (mostly pictures). I do have some redundancy. Since this may be the result of malware, I’ve disconnected my main computer from the Internet.

I now want to view a list of my thousands of filenames to a spreadsheet or workbook. I’m fairly proficient with spreadsheets. I can data/sort to find what is really important and save to Excel after culling out duplicates with Duplicate Cleaner Pro. Finally save these important files to a separate external drive and protect it.

How do I export filenames from each of my several drives to spreadsheet or workbook?
 

My Computers My Computers

  • At a glance

    Windows 1113th Gen Intel(R) Core(TM) i5-13400F 2.50 GHz32.0 GBNVIDIA Gforce RTX 4060
    OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Device name CyberPowerPC
    CPU
    13th Gen Intel(R) Core(TM) i5-13400F 2.50 GHz
    Memory
    32.0 GB
    Graphics Card(s)
    NVIDIA Gforce RTX 4060
    Hard Drives
    2 TB ADATA Legend 800 Gold SSD and several HDDs
    PSU
    650W
    Browser
    Chrome
    Other Info
    Windows 11 23H2 10.0.26100 Build 26100
  • At a glance

    Windows 10 Home 22H2 19045.4123Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz 3.60 GHz32.0 GBGforce GTX 745
    Operating System
    Windows 10 Home 22H2 19045.4123
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acer_Desktop
    CPU
    Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz 3.60 GHz
    Memory
    32.0 GB
    Graphics card(s)
    Gforce GTX 745
    Sound Card
    ONN24
    Hard Drives
    Many
    Keyboard
    JLAB supports 2 computers/monitors
    Mouse
    Acer wired USB
    Browser
    Chrome
    Antivirus
    Only what W10 installed
    Other Info
    64-bit operating system, x64-based processor
  • OS Windows 11 Home 25H2, 26200.8894, 5/‎20/‎2025

    Computer type = PC/Laptop

    Manufacturer/Model = HP

    Device name = Victus

    CPU = 12th Gen Intel(R) Core(TM) i7-12700H (2.30 GHz)

    Motherboard

    Memory = 16.0 GB (15.7 GB usable)

    Graphics Card = NVIDIA GeForce RTX 3050 Laptop GPU (4 GB)

    Sound Card = Internal

    Monitor(s) Displays = Attached

    Screen Resolution = UNK

    Hard Drives = 954 GB and several external HDDs

    PSU = UNK

    Case = NA

    Cooling = UNK

    Keyboard = NA

    Mouse = Wireless Logitech (Touchpad also)

    Internet Speed = 31Mbps download; 8.24 Mbps upload

    Browser = Chrome

    Antivirus=Windows Defender only

    Other Info
Didn't really test, but there is nothing destructive about it. From Powershell copy/paste and run
Powershell:
$ExportFile = "$($env:username)\Desktop\AllFiles.csv"

$Volumes = Get-Volume | ? { -not [string]::IsNullOrEmpty($_.DriveLetter) -and $_.FileSystemType -notlike "Unknown"}

foreach ($Volume in $Volumes) {
    $DriveLetter = "$($Volume):\"
    $Files = Get-ChildItem -Path $DriveLetter -Recurse -File -ErrorAction SilentlyContinue

    $Files | Select-Object -Property Name,FullName | Export-Csv -Path $ExportFile -Append
}
 

My Computer My Computer

At a glance

Linux Mint
OS
Linux Mint
Computer type
Laptop
Manufacturer/Model
System76 Lemur Pro
Probably should throw in LastWriteTime to the -Property list.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7

Latest Support Threads

Back
Top Bottom