General Question

tomasreichmann's avatar

DOS batch file that prints out contents of a folder in notepad?

Asked by tomasreichmann (125points) November 19th, 2009

I had a DOS batch file, that printed contents of a folder into a notepad text file, but I lost it and now I can’t find it anywhere, not even on google. Does anyone has it, know how to make it or know a site, where I can get it?

Observing members: 0 Composing members: 0

5 Answers

markyy's avatar

You must not have looked very hard :) First result on Google when searching for: contents of a folder into a notepad text file.

ratboy's avatar

You can save the following as gen.bat:

@ECHO OFF
DIR /B %1 > %2”.TXT”

Then typing “gen <DNAME> <FNAME>” will create a file named FNAME.TXT in the current directory containing the contents of the directory DNAME.

For example:

gen “C:\Documents and Settings” PROGS

will create the file PROGS.TXT containing the contents of C:\Documents and Settings.

tomasreichmann's avatar

I don’t know how I missed that, it certainly wasn’t first on my searches. In the meantime, I found the original file and it seams it’s a little bit more elaborate:

@echo off
chcp 1250
dir /B %1>%TEMP%\content.txt
start /wait notepad %TEMP%\content.txt
del %TEMP%\content.txt

But thanks guys :-) May this help anyone looking for this in the future.

gtponder's avatar

Try “ReNamer.exe”—Google it – Free, wors great!

gtponder's avatar

Sorry, works great.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther