Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

"Print" directory contents to a file


  • Please log in to reply
3 replies to this topic

#1 Capn Easy

Capn Easy

  • Members
  • 597 posts
  • OFFLINE
  •  
  • Location:New Jersey
  • Local time:03:34 AM

Posted 25 March 2010 - 11:40 PM

I can do this (easily) with UNIX, my old Amiga, and even MS-DOS. I would like to "print" the contents of a directory to a new file. For instance, if I have a directory for a particular album of music I would like to create a new file in that directory, perhaps entitled Contents, with the names of all the MP3s in it.

I found instructions at a Microsoft support page, <HERE> which kind of does what I want, but it sends the contents directly to the printer without the option to catch it in a file -- so, not quite what I need.

Does anyone have a relatively simple way to do this?

Thanks.

Edited by Capn Easy, 25 March 2010 - 11:41 PM.


BC AdBot (Login to Remove)

 


#2 powerjuce

powerjuce

  • Members
  • 321 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:34 AM

Posted 25 March 2010 - 11:50 PM

  • Click on Start
  • Click on Run
  • Type in "cmd" (without the quotes)
  • In the box that appears, cd to the director that you want
  • To list say all the mp3s in that directory type in "dir /b /a *.mp3 > dirlist.txt" (without the quotes)
  • That should create the file in that directory
  • If you wish, you can put that command into a batch file.
Hope that helps.
~powerjuce

#3 Capn Easy

Capn Easy
  • Topic Starter

  • Members
  • 597 posts
  • OFFLINE
  •  
  • Location:New Jersey
  • Local time:03:34 AM

Posted 26 March 2010 - 12:03 AM

Thanks, powerjuce!

Actually, after I left here I had a delayed "aha!" moment. The Windows support solution was a short batch file, and I realized that it opened Notepad with a "/p" switch -- I took that out and it opens Notepad and I can save, print, etc.

But your solution looks pretty clean and it's faster than the Notepad approach -- I know I'll find a use for it!


Thanks again!

#4 Ken-in-West-Seattle

Ken-in-West-Seattle

  • Members
  • 518 posts
  • OFFLINE
  •  
  • Local time:12:34 AM

Posted 26 March 2010 - 11:48 AM

Batch command reference for future use:

http://www.allenware.com/icsw/icswref.htm




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users