Site icon SumTips

Add Create Folder List, Copy File/Folder Name to Explore Context Menu

In this post, I will show you how to add three useful items – ‘Generate Folder List’, ‘Copy File/Folder Name’ and ‘Copy File/Folder Path’ – to the Windows Explorer context menu.
Windows Folder Context Menu

Add “Create Folder List” Option to Explorer Folder Context Menu

Ever wished there was a quick option to generate a listing of all files and folders within a directory? It’s a simple request, but sadly such a feature is not available in Windows Explorer. No worries! There is a simple workaround that doesn’t even require any additional software. So here’s how to create a new context menu item that when clicked will generate a text file listing of the selected directory.

Before creating the entry itself, first up we need to create a .bat file that generates the listing. To do that, open Notepad ( any text editor would do) and paste the following inside it:

@echo off
dir %1 /b /-p /o:gen > foldercontent.txt
start notepad foldercontent.txt
exit

Save the file with the name ‘FolderList.bat’ to your desktop. Next move this file to C:\Windows folder. We saved the batch file first to desktop because system permissions wouldn’t have allowed you to directly save it in Windows directory.

dir %1 /b /-p /o:gen > foldercontent.txt – This is the code that generates the file listing. It is also the one that saves the list in a text document named ‘foldercontent.txt’ at the folder root location. You can change the file name to anything you like.

The generated list will contain only file/folder names. If you’d like more info like file size, file created date, etc. then remove the /b switch from the code.

start notepad foldercontent.txt – This line tells the BAT script to start foldercontent.txt document in Notepad. To use any other text editor, replace notepad with the complete path of your editor. Also, remember to change the txt document’s file name here if you had change it in the previous line.

Now we will add a new context menu item. Open another instance of Notepad and paste the following in it.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Shell]
@="none"

[HKEY_CLASSES_ROOT\Directory\Shell\Directory List]
@="Create Folder List"

[HKEY_CLASSES_ROOT\Directory\shell\Directory List\command]
@="FolderList.bat \"%1\""

Save this as a .reg file named ‘Install_Folder_List.reg’ on your desktop. Again, you can name this file anything you like.

@="Create Folder List" – This is the context menu item’s text that is seen in the menu. Change it if you would like something else.

@="FolderList.bat \"%1\"" – The is the name of the BAT file we had saved in the Windows directory in the previous step.

Double-click on the .reg file and agree to the prompts to make changes to Windows Registry. That’s it! Test out the new option by right-clicking on any folder.

If you’d like a ready made script for this context menu item, download the below ZIP file. I have also included an uninstall script to remove the menu item, but you have to manually delete the BAT script from Windows directory.

Download: Create Folder List

Add ‘Copy File/Folder Name’ and ‘Copy File/Folder Path’ to Explorer Context Menu

‘Copy File Name’ context menu item would allow you to directly copy the selected file name’s path to the clipboard. To add this entry, we will use this script: http://www.gnostice.com/newsletters/downloads/2009_07/CopyFileFolderPathNameUtilities.zip. Download and extract the zip file.

At extracted path, inside ‘CopyFileFolderPathNameUtilities’ folder, you will find another folder named ‘Copy Filename’. Copy that folder to C:\Program Files\. Open C:\Program Files\Copy Filename and double-click on the file ‘Install_Copy_Filename.reg’ file. When Registry Editor prompts you, select “Yes” and “OK” to allow changes. Right-click on any file or folder to see the newly added item.

Explorer, by default, comes with a ‘Copy as Path’ option which lets you copy file/folder path directly to clipboard. This option is hidden by default. To see it, right-click on a file/folder keeping the ‘Shift’ key pressed. If you don’t like this method, you can install ‘Copy Pathname’ script to get an alternate always visible ‘Copy File Path’ option.

For more ways to enhance Windows context menu, check out this post.

Exit mobile version