How to Add the Windows Copy File List Right-Click Command
Question details
The user wants to understand what the Copy File List command is in Windows and how to manually add this custom entry to the right-click context menu to quickly copy file names.
- Product
- Windows
- Device & OS
- Windows
- Scenario
- Generating a list of file names from a specific folder without having to manually type each one.
- Observed behavior
- Users need a custom right-click context menu option that executes a command to automatically copy folder contents to the system clipboard as text.
Before modifying the Windows Registry, ensure you have administrative privileges and create a backup of your registry settings to prevent any unintended system instability.
Add the Copy File List Command via Windows Registry
Use the Windows Registry Editor to create a custom context menu action that utilizes the command prompt to list files and pipe the output to your clipboard.
The Copy File List command is a powerful custom shortcut that saves time when cataloging files. By adding specific keys to the Windows Registry, you can execute a Command Prompt command directly from the right-click menu.
Press the Windows key + R to open the Run dialog. Type 'regedit' and press Enter to launch the Registry Editor.
In the left pane, carefully navigate to the following path: HKEY_CLASSES_ROOT\Directory\shell.
Right-click on the 'shell' folder, select New, then click Key. Name this new key 'CopyFileList'. You can double-click its Default value in the right pane and set it to 'Copy File List' so it displays nicely in the menu.
Right-click the newly created 'CopyFileList' key, select New, and then click Key. Name this subkey 'command'.
With the 'command' key selected, double-click the (Default) string value in the right pane. Set the Value data exactly to: cmd /c dir "%1" /b /a:-d /o:n | clip
Close the Registry Editor. Right-click on any folder in Windows File Explorer, select 'Copy File List', and then press Ctrl+V in a text editor like Notepad or WPS Writer to verify the file names were copied successfully.
Organize Your Copied File Lists with WPS Office
Once you have successfully copied your file names using the Windows context menu command, you need a reliable place to paste and organize them. WPS Office allows you to seamlessly paste, format, and manage your file lists into neat documents or spreadsheets.
- 1. Open a New Document or Spreadsheet: Launch WPS Office on your computer and open a blank WPS Writer document or WPS Spreadsheet depending on how you want to organize your files.
- 2. Paste the Copied File List: Right-click on the blank workspace or simply press Ctrl+V on your keyboard to paste the file list you copied using the custom Windows command.
- 3. Format and Sort Your Data: Use WPS Office's intuitive formatting tools to convert the pasted text into a checklist, sort the items, or divide the file names into separate spreadsheet columns for better data management.

Frequently Asked Questions
What should I do if the Copy File List option doesn't appear when I right-click?
Ensure you added the registry keys precisely under 'HKEY_CLASSES_ROOT\Directory\shell'. If you shift-right-click, sometimes additional options appear. Restarting Windows File Explorer from the Task Manager can also force the context menu to refresh.
Can I copy the file paths instead of just the file names?
Yes. By modifying the registry command to use different command prompt parameters, you can include full paths. However, for just file paths without manual registry editing, Windows 10 and 11 have a native 'Copy as path' option when you select files and press Shift + Right-click.
How can I remove the Copy File List command later?
To remove the command, open the Registry Editor, navigate back to 'HKEY_CLASSES_ROOT\Directory\shell', and delete the 'CopyFileList' key you created. The option will immediately disappear from your right-click menu.
Why is the pasted list missing the folder names?
The specific command used (dir /a:-d) is intentionally designed to exclude directories (-d). If you want to include folders in your copied list, remove the '/a:-d' parameter from the registry command data.




