Power Query Problems

How to Export File Name, Size, and Length from File Explorer to Excel

Anum MushtaqAnum Mushtaq Nov 3, 2026 868 views

Question details

The user wants to extract video file metadata (such as file name, size, and length) from a local directory into an Excel spreadsheet, creating one row per file.

How to Export File Name, Size, and Length from File Explorer to Excel
Product
Excel
Device & OS
not provided
Scenario
Creating a spreadsheet directory or inventory of video files with their detailed properties.
Observed behavior
The user needs a reliable method to import multiple file properties from a folder into a structured Excel table without manual data entry.
Before you start

Gather all the video or media files you want to list into a single folder on your computer to streamline the import process.

Solution 1Recommended

Use Excel Power Query to Extract File Data

Using the 'Get Data' feature is the recommended method for repeatable, automated file imports directly from a folder.

Power Query is a built-in Excel tool that allows you to connect to a folder and automatically extract the properties of all files inside it. This method is highly recommended because it can be refreshed later if you add or remove files.

1
Open Get Data from Folder

In Excel, go to the 'Data' tab on the ribbon, select 'Get Data', choose 'From File', and then click 'From Folder'.

2
Select the target folder

Browse your computer to locate the folder containing your video files, select it, and click 'Open'.

3
Transform the metadata

A preview window will appear. Click 'Transform Data' to load the file metadata table into the Power Query Editor.

4
Clean up columns and load

Keep the 'Name', 'Size', and other relevant attribute columns. Right-click and remove any columns you do not need, then click 'Close & Load' to output the data to your Excel worksheet.

Use Excel Power Query to Extract File Data
Repeatable Import: Once set up, you can simply click 'Refresh All' on the Data tab to automatically update your Excel list whenever new files are added to the folder.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

If you frequently manage large data sets, file inventories, or complex imports, WPS Office is an excellent lightweight alternative. It offers a familiar interface, supports standard spreadsheet formats, and provides powerful data management features completely free.

  1. 1. Download WPS Office: Visit the official WPS website and click 'Download WPS Office Free'.
  2. 2. Install the application: Run the lightweight installer and follow the on-screen prompts to set up the software.
  3. 3. Open your spreadsheets: Launch WPS Spreadsheet and easily open or edit your existing .xlsx file inventories.
Fully compatible with Microsoft Excel formats (.xlsx, .csv, .xls).Lightweight software that processes large data sets and lists quickly.Familiar user interface with no learning curve for Excel users.Free built-in PDF tools and advanced data formatting options.
microsoft office alternative - wps office

Frequently Asked Questions

Can I export file properties using a command prompt instead of Excel?

Yes. You can open Command Prompt, navigate to your target folder, and type 'dir /b /s > list.txt' to generate a text file of the directory contents. You can then import this text file into Excel using the Text Import Wizard.

Does the Power Query method automatically update if I add new videos?

Yes, Power Query creates a dynamic data connection. When you add new files to the linked folder, simply go to the Data tab in Excel and click 'Refresh All' to update the table with the latest file names and sizes.

Why doesn't the browser drag-and-drop method copy the video length?

A web browser's directory index typically only reads basic system file attributes like name, size, and date modified. It does not read deeper media metadata such as video length or audio duration.

Can I extract exact video length (duration) using standard Power Query?

Standard Power Query does not directly extract media-specific metadata like video duration from the file system. To get the exact media length, you may need to use a PowerShell script to extract the extended file properties before importing the results into Excel.