Print full directory of HDD

Asked By 0 points N/A Posted on -

Hello Friends,

I need to print full directory of HDD or any specified folder. Please do let me know about, how to get this done using the batch file script.

Thanks & Regards,


Best Answer by Onnon herald
Best Answer
Best Answer
Answered By 0 points N/A #198822

Print full directory of HDD


Here's a way to print a folder's contents in Windows.

To create a batch file to perform the above, follow these steps:

Launch Notepad (Start -> Programs -> Accessories -> Notepad) and enter the following three lines:

dir %1 > c:windowstempdir.txt

notepad c:windowstempdir.txt


Make sure that "cls" is on the very last line of the file. You do not want even a blank line below it.

Save the file as: c:program filesaccessoriesprintdir.bat

That is, name your file: printdir.bat (make sure you use the drop down menu to save the file as a batch file with a .bat extension. Then save it to the accessories folder which is found in the program files directory of your c drive.

Then exit Notepad.

Launch Windows Explorer and select View ** Folder Options (or View ** Options or Tools ** Folder Options).

In the Folder Options dialog box, click the File Types tab.

In the list of 'Registered file types', scroll down to and double-click on "File Folder". (In Windows Me, select File Folder then click the Advanced button.)

In Edit File Type dialog box, click the New button. In the New Action dialog box's Action field, type Print. For 'Application used to perform action' type "c:program filesaccessoriesprintdir.bat" (don't forget the quotation marks).

Click OK and Close buttons until you're back in Explorer.

From now on, when you want to print a folder's contents, right-click the folder and select Print. The batch file will bring the file list up in Notepad, where you can print it by selecting File ** Print.

Answered By 0 points N/A #198824

Print full directory of HDD


In order to print contents list of a specified folder on your hard drive using batch script file, you need a printer installed with your Windows and then follow this path:

Start > All programs > Accessories > Notepad.

In Notepad Enter:

dir % 1 > c: windowstempdir.txt

notepad c:windowstempdir.txt


Save this File as: c:program files accessories printdir.bat

Launch Windows Explorer > View Folder options > File Types tab.

You will see a list of “Registered File Types” > double-click on File Folder.

A dialog box will appear named “Edit File Type”, Click “New” button and type “Print” > OK.

After done with these settings, whenever you want to print a specific folder on your hard drive, right-click on the folder and press Print.


To print the full directory on your hard drive using batch script, type this command:

C:dir > lpt 1


Answered By 574090 points N/A #299889

Print full directory of HDD


If you want to print the entire contents of a hard drive which consists of files and folders, you have to put it in a file first and then print it on Microsoft Office Word, for example. The easiest way to list the contents of a hard drive is from the command prompt and by just using the “dir” command.

The “dir” command is a DOS command that lists or displays the files and subfolders in a directory or folder. To create the file that will contain the directory listing of the hard drive, click “Start,” “All Programs,” “Accessories,” and then “Command Prompt.” In the command prompt window, enter without quotes “cd\” then hit Enter. This will bring the command prompt to the root of the drive.

Bring command prompt to root

Once you’re in the root of the drive, you can now create the file. Actually, you can create the file even if you are not in the root. It’s just easy when you’re in the root. Now, to create the file, enter without quotes “dir/s > listing.txt” then hit Enter. After this, the file “listing.txt” should be created. The contents of the file should look something like this:

Directory listing in file

Depending on the size of the contents of the drive, creating the file should take time. You should never interrupt while the file is getting created. When it is finished, just open it in Microsoft Office Word and print it.

Login/Register to Answer

Related Questions