Windows print working directory

How to add the print directory feature to Windows Explorer

This article describes how to add the print directory feature, and how to enable printing of the directory listing from within Windows Explorer.

Original product version: В Windows 10 — all editions, Windows Vista
Original KB number: В 272623

Summary

For more information about How to add the Print Directory feature for folders in Windows XP, in Windows Vista, or in Windows 7, click the following article number to view the article in the Microsoft Knowledge Base: 321379 How to add the Print Directory feature for folders in Windows XP, in Windows Vista, or in Windows 7

More information

To add the print directory feature to Windows Explorer, follow these steps:

Step 1: Create the Printdir.bat file

To do this, follow these steps:

Click Start, click Run, type notepad, and then click OK.

Paste the following text into Notepad:

On the File menu, click Exit, and then click Yes to save the changes.

In the Save As dialog box, type the following text in the File name box, and then click Save: %windir%\Printdir.bat

If you receive a dialog box that states that you do not have permission to save in this location, you can save the file to the desktop. Next, you click Start, click Run, type %windir%, and then click OK. Then, you can copy the file from the desktop to the location.

Step 2: Edit the registry

This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 How to back up and restore the registry in Windows

Click Start, click Run, type Notepad, and then click OK.

Type the following commands in Notepad.

On the File menu, click Save As.

In the Save in list, click Desktop.

In the File name box, type PrintDirectoryListing.reg, click All Files in the Save as type list, and then click Save.

On the desktop, double-click the LoggingOn.reg file to add the registry keys to the Windows registry.

Click OK in the message box.

How do I print directory list Windows 10?

‘Print.txt’ is not recognized as an internal or external command, operable program or batch file.

Replies (20) 

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

It should be «List.txt»

5 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Had to look at my old DOS book to figure it out.

Читайте также:  Активация microsoft office 2013 professional plus для windows 10

For my purpose TREE/F works.

I direct it to: >E:List.txt or other directory of choice.

For CD and DVD the tree list has to be directed elsewhere.

Output will not go to the Disk.

7 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

‘Print.txt’ is not recognized as an internal or external command, operable program or batch file.

«Print.txt» is just a file name, not a command so it can’t do anything. The command you want to use is «DIR». You can use it to create a text file which you can then print out. (caps not necessary)

The DIR command has many switches/options, which you can display by typing «dir /?»

The simplest use of the «Dir» command would be to open a command prompt within the folder where you want to list the contents and type «dir >anyname.txt» (without the quotes). This will create a text file listing the top level (not including subfolders) of the contents in that folder with whatever name you gave that file. You can then print the file.

You can open a command prompt either from Windows System in the «All Apps» menu or by using File Explorer and Shift key + Right Click on the folder you want the command prompt to open in, then from the context menu select «Open Command Prompt Here».

www.makeuseof.com

Follow MUO

5 Ways to Print Folder and Directory Contents in Windows

Yes, you can print a list of files in a folder or directory. We’ll show you five ways to do that, including a cmd solution and Karen’s directory printer.

Years ago, I had collected a massive folder filled with over 100 different ebooks, and one of my friends casually asked if I could send over a list of all those titles. It sounded so easy, but I hesitated. Was I supposed to type them all up by hand? I almost did, but I wanted an easier option.

No way I was going to type up that many titles. My days are busy enough already!

Fortunately, solutions do exist. Whether you’re a home user or part of a business, you may one day need to print a list consisting of a directory’s entire contents — and when that day comes, the following methods will save you a boatload of time. In this article, we’ll show you five different ways to print folder contents as a list.

1. Command DOS

This is one of many command-line commands that are easy to remember and easy to perform:

  1. Start the Command Prompt by opening the Power Menu (Windows key + X) and selecting Command Prompt. Use the cd command to navigate to the directory you want to print. (Learn more about the cd command!)
  2. Type dir > print.txt.
  3. Press Enter and exit the Command Prompt.
  4. In File Explorer, navigate to the same folder and you should see a print.txt file. This is a plain text file that can be opened in Notepad (or any other text editor) and then printed.

2. Setting a Contextual Menu

A print directory feature can be added to the right-click context menu for any folder. This sends the folder content list directly to the printer. For Windows 10, follow these steps:

  1. Launch Notepad (or your preferred text editor).
  2. Paste the following:
  3. Save the file as %WinDir%\Printdir.bat, which will place it in the root Windows system directory. (If you can’t due to permissions, save it wherever you want and then manually move it to the C:/Windows directory.)
  4. Close Notepad.
  5. Launch Notepad again to create a new file.
  6. Paste the following:
  7. Save the file as %UserProfile%\Desktop\PrintDirectoryListing.reg, which will place it on your desktop.
  8. Go to your desktop and double-click on the PrintDirectoryListing.reg file. This will modify the Windows Registry, which can be risky! If you’re worried, first back up the Registry.
  9. Right-click inside a folder and select Print Directory Listing to directly print the list.
Читайте также:  Варианты загрузки windows с bios

3. Karen’s Power Tool

Karen’s Directory Printer is a GUI tool with rich features, but our main concern is its ability to print the names of files alongside other bits of data, such as file size, extension, date and time of last modification, and attributes.

The printed list of files can be sorted by name, size, date created, date last modified, or date of last access. The list of files can also be filtered to only include files that meet certain criteria, and the resulting list can be formatted or highlighted (but only to a limited degree).

Karen’s Directory Printer can be included in the right-click context menu, and also works for networked computers. The file list can be sent directly to the printer or saved as a text file.

4. Directory List & Print

Directory List & Print is a simpler and smaller solution than Karen’s Directory Printer. The generated lists can be copied to the clipboard and pasted in other programs, or they can be directly inserted into programs like Word and Excel with a single click.

Since the data is separated by tabs, it can even be free-pasted into Excel as a table!

Along with file attributes, Directory List & Print can control the display of file names with or without file extensions. It also provides options for sorting the resulting list and integrating into the right-click context menu. The Pro version can include even more advanced data, such as checksums, media dimensions, meta file properties, and more.

Download: Directory List & Print (Free, $22 Pro)

5. JR Directory Printer

JR Directory Printer is the lightest of the three third-party apps in this article, coming in at a download size of just 173KB. It’s portable, so it doesn’t even need to be installed.

To launch it on Windows 10, you’ll have to run it in compatibility mode:

  1. Right-click on JDirPrinter.exe and select Properties.
  2. Under the Compatibility tab, check Run this program in compatibility mode and select Windows XP (Service Pack 3).

It’s easy to use after that. Select the folder you want to list, choose whether you want to recurse («include») all of its subfolders and whether you want to lowercase filenames, then click Start. It’ll create and open a file called DirPrint.txt, which you can edit or copy for elsewhere.

Other options (under the Display tab) include file size in KB/bytes, attributes, and custom file length. It’s very lightweight and simple, but it’s meant to be.

Download: JR Directory Printer (Free)

How Do You Print Directory Contents?

Windows may not have the native ability to print out folder contents in a user-friendly way, but thanks to the workarounds and all the freeware, it’s actually a snap.

Do you know any other utility to print the contents of a folder? Let us know your way if it differs from any of the above.

Originally written by Saikat Basu in October 2009.

Here’s how to connect your phone to your car using Android Auto wireless, and what’s required to utilize this feature.

Joel Lee is the Editor in Chief of MakeUseOf since 2018. He has a B.S. in Computer Science and over nine years of professional writing and editing experience.

Subscribe To Our Newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

Читайте также:  Если windows 10 не поддерживает удаленный рабочий стол

One More Step…!

Please confirm your email address in the email we just sent you.

Power to Build

Power of building and using beautiful Software

Home » Misc » Quicktip: Windows 7 Batch File – Current Working Directory

Quicktip: Windows 7 Batch File – Current Working Directory

Archives

Windows Current (Working) Directory
When you are running a script in Windows command line (old DOS prompt), you have 2 paths to deal with:
Current (Working) directory and
Path of the script you are running.

Most of the time, they may be the same. Sometimes, you would change working directory to a different path, so you can pick up files/scripts from there. If you ever set up a shortcut to a batch file, you will see a Start in Folder – this corresponds to the current working directory. This can be different from actual path of the script.

To change directory in Windows command line, you can use the CD command. This command affects the current working directory. Windows stores the current working directory in a special variable called %CD%. This variable can be used both on command line and in batch files.

To save the Current working directory, before running a step in a batch file (like calling another script), you can use PUSHD. This simply saves the current path in a stack. Upon return, you can simply do a POPD operation to restore the current working directory.

Windows 7 Default for Current (Working) Directory
Windows 7 sometimes defaults current working directory to C:\Windows\System32 (%Windir%\System32) in command prompt (This incidentally is the path of the cmd.exe). So, if you have some old Batch File scripts that ran fine earlier and suddenly fail to find programs/scripts, chances are, your script is suffering from the above defaulting behavior.

To overcome this, I add the below lines to the top of all my scripts, to force the current

The above snippet forces the current working directory back to the directory where the script is run from. I could have simply said cd /d %

dp0, but I save it in a variable that I can use elsewhere in the script.

Script Arguments and Modifiers

The weird syntax with tilde (

), in the above code snippet, is a special modifier to dissect paths in a Windows Batch File.

If you want to get the full path of a script, you can use the variable %0. For e.g., if you are running a script, c:\dev\test.bat, then

If you want to get parts of this path string, then you would use modifiers. %

p0 refers to the path without the drive letter of the %0.

To get the Drive letter alone, you can use %

d0. This will print C:

You can combine the 2 using %

dp0. This gives the drive letter and path (minus the file name).
(To get fully quality path name use f instead of p).

You can also get just the file name, by using the modifier n and x to get the extension. So to print only name of the script (minus the directory it is in), use %nx0.

%0 refers to the script being run. %1 – %9 are the command line arguments (if any) passed into this scripts. You can use the modifiers on these arguments the same way as well. For e.g., if you have a command like,

%0 refers to process_data.bat
%1 refers to c:\data\datafile.dat

%dp1 would then give us c:\data, the directory in which data file is located and %nx1 will give you datafile.dat.

Unlike the CD command, getting the parts of the path of a script/file can only be done inside the script. These cannot be run on command line as such.

There is a lot more to parameters and modifiers. See here , here , here for details.

Оцените статью