Thursday, September 10, 2026

Create file list and path from ANY Harddidk or Drive export to excel

 If you want to make list of files from any drive or folder and make export this list to excel then windows is the best for it. Simple you have to run these commands and it will make excel file on your desktop.

If the hard disk is connected to your Windows PC, you can create an Excel list of every folder and file automatically, including:

  • Full folder/file path
  • File name
  • Extension
  • File size
  • Date modified

For 2 GB of data, this should be easy.

Easiest method — PowerShell

Suppose your hard disk is D:.

  1. Connect the hard disk.
  2. Open PowerShell.
  3. Run this command:
Get-ChildItem -Path "D:\" -Recurse -File -ErrorAction SilentlyContinue |
Select-Object FullName, Name, Extension, Length, LastWriteTime |
Export-Csv -Path "$env:USERPROFILE\Desktop\HardDisk_File_List.csv" -NoTypeInformation -Encoding UTF8

It will create:

Desktop\HardDisk_File_List.csv

Open that file with Excel.

If you also want folders

Use:

Get-ChildItem -Path "D:\" -Recurse -ErrorAction SilentlyContinue |
Select-Object FullName, Name, Extension, Length, LastWriteTime, @{Name="Type";Expression={if ($_.PSIsContainer) {"Folder"} else {"File"}}} |
Export-Csv -Path "$env:USERPROFILE\Desktop\HardDisk_Folder_File_List.csv" -NoTypeInformation -Encoding UTF8

This gives you both folders and files.

No comments:

Post a Comment