I recently found myself need to find a way of generating a list of files to a text file and I knew you could do this in DOS quite easily, but you have to type it in every time, so I did a bit of searching around on the web and found 2 useful pages and updated for Windows 7 and combined them.
Firstly, over at Renegade minds there is a useful script for older versions of windows that does the whole list of files thing, open it up in notepad and the delete the file once you are done.
The problem I found with this is that it wanted to write to the root of the C: drive and on Windows 7 this might have some permissons issues (cmd needs to run as admin). Simple solution was to just write to the folder you are in (the one below the one you are trying to get a file list of.
I also removed a load of echo text stuff as it's not needed.
This is my version of the Renegade Minds script:(cut'n'paste minus the start and end)
Start
@echo Dumping directory listing to dirListing.txt
@REM the /A switch lists all hidden and system files as well.
@REM the /S switch lists all subdirectories and their contents.
@dir %1 /A /S > dirListing.txt
@echo Opening dirListing.txt in Notepad (Close notepad to delete file)
@notepad dirListing.txt
@echo Deleting dirListing.txt
@del dirListing.txt
@pause
End
The other thing I did was change the file name to 'Notepad File List.bat' but you could call it anything you want.
The next clever thing is to add it to your 'Send To' right button mouse menu.
The result of a quick search for this found the answer down at ThinkGeek and it was a simple case of opening a new explorer window and pasting:
%APPDATA%\Microsoft\Windows\SendTo
then pressing return.
This opens your own personal Send To folder and you can save you Notepad File List.bat in here.
Now if you right click on any folder and send to notepad file list it will quickly pop up a dos cmd prompt and a notepad window, then a few seconds later the notepad should have a list of all the file and files in subdirectories of that folder you sent to the batch file.
when you close notepad it will delete the temporary file it creates but if you want to keep the listing the you can jsut save it off under a different filename.
I hope this makes sense and you find it useful
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.