Useful
The other day I found this script at
Tech-Recipes.com that brings filenames from a Windows directory into Notepad. Supremely useful sometimes, thought I'd put it here in case someone needs it in the future:
Directions
Often I need to print or email somebody a listing of a folder's contents. Windows does not have an easy way to do this.
The creation of this file will make this task very simple.
1. Open Notepad
2. Copy and paste the following text:
@echo off
if EXIST %1 goto start
echo Drag and drop any file onto this program to grab its parent directory listing.
pause
goto end
:start
echo "%~dp1"
dir "%~dp1" > dir.txt || pause
start dir.txt
:end
3. Under the File menu select Save as
4. As you want to save this to your desktop, browse to the appropriate location.
5. Under filename type dirlist.cmd
6. Under Save as type select All Files
7. Click OK
A file called dirlist.cmd should be created on your desktop. Clicking this file will just give you the echo message and not do anything productive.
To use your new tool, drag any file onto this newly created item on your desktop. The directory contents of that file's folder will be opened in notepad.
For example, to print out a listing of my toolbar directory, I would navigate to my toolbar directory and drag any file in the toolbar directory to the dirlist.cmd file.
* Ray, 12/05/2004 12:50:26 PM