logo
search
OneDrive File Issues

How to Copy OneDrive File Names to a Text List

Maira MehtabMaira Mehtab Sep 27, 2026 871 views

Question details

The user needs to copy or extract the file names from a OneDrive folder into a plain text list in bulk.

Product
OneDrive
Device & OS
Windows
Scenario
Attempting to copy multiple file names directly from the OneDrive web interface to create a text list.
Observed behavior
The OneDrive website viewed in Microsoft Edge restricts text selection, preventing users from directly highlighting and copying the names of the files.
Before you start

Ensure you have the OneDrive desktop application installed and synced to your Windows PC, as you will need local access to the folder via File Explorer.

Solution 1Recommended

Use Command Prompt for Bulk Copying

By syncing your OneDrive folder locally to Windows, you can use a simple Command Prompt trick to generate a text document containing all your file names instantly.

This method is highly recommended when dealing with dozens or hundreds of files. It circumvents browser limitations by interacting directly with the Windows file system.

1
Sync OneDrive Folder

Open the OneDrive app on your Windows PC and ensure the specific folder containing your files is synced locally to your hard drive.

2
Open File Explorer

Navigate to the synced OneDrive folder using Windows File Explorer.

3
Launch Command Prompt

Click on the address bar at the top of the File Explorer window, type 'cmd' (without quotes), and press Enter. This will open a Command Prompt window mapped directly to your folder.

4
Run the Directory Command

In the Command Prompt window, type 'dir /b > list.txt' and press the Enter key.

5
Retrieve Your Text List

Return to the folder in File Explorer. You will see a newly created file named 'list.txt'. Open it to view and copy all your file names.

Pro Tip: You can change 'list.txt' to 'list.csv' in the command if you prefer to open the generated list directly in a spreadsheet application.
Free Microsoft Office alternative

Easily Organize Your Extracted File Lists with WPS Office

Once you have generated your OneDrive file list, editing and organizing it is a breeze with WPS Office. As a free, lightweight, and user-friendly alternative to Microsoft Office, WPS allows you to open your text lists, format them beautifully, or even convert them into structured spreadsheets seamlessly.

  1. 1. Open WPS Office: Launch WPS Office on your computer and select the 'Spreadsheets' or 'Document' tool depending on how you want to format your list.
  2. 2. Import Your Text File: Drag and drop the generated 'list.txt' file directly into the WPS interface to open it.
  3. 3. Organize Your Data: Use the built-in formatting tools to sort alphabetically, highlight specific names, or convert the text data into an organized table.
Fully compatible with Microsoft Word, Excel, and plain text formats (.txt, .docx, .xlsx).Seamlessly convert plain text file lists into organized spreadsheet tables.Lightweight installation with a familiar, tabbed user interface.Built-in cloud integration for easy management of your OneDrive files.
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I copy file names directly from the OneDrive website in Microsoft Edge?

Certain modern web browsers like Microsoft Edge may restrict standard text selection on dynamic web applications (like the OneDrive interface) to prevent accidental drag-and-drop actions or interface conflicts.

What exactly does the 'dir /b > list.txt' command do?

The 'dir /b' command instructs Windows to list only the bare file and folder names without extra directory details like file sizes or dates. The '> list.txt' portion redirects that output to create a new text file named list.txt within the same folder.

Can I output the OneDrive file names directly into a spreadsheet format?

Yes. By altering the command slightly to 'dir /b > list.csv', Windows will generate a Comma Separated Values file. You can then double-click this CSV file to open your list directly in spreadsheet programs like WPS Spreadsheets or Microsoft Excel.