How to Copy OneDrive File Names to a Text List
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.
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.
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.
Open the OneDrive app on your Windows PC and ensure the specific folder containing your files is synced locally to your hard drive.
Navigate to the synced OneDrive folder using Windows File Explorer.
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.
In the Command Prompt window, type 'dir /b > list.txt' and press the Enter key.
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.
Manual Rename Method for Small File Quantities
If you only need to copy a handful of file names, you can manually extract them using the rename function, avoiding the need for Command Prompt.
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. 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. Import Your Text File: Drag and drop the generated 'list.txt' file directly into the WPS interface to open it.
- 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.

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.




