{"id":1269,"date":"2014-02-18T09:51:19","date_gmt":"2014-02-18T14:51:19","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=1269"},"modified":"2014-02-18T09:51:19","modified_gmt":"2014-02-18T14:51:19","slug":"how-to-print-a-directory-tree-from-windows-explorer","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=1269","title":{"rendered":"How To Print A Directory Tree From Windows Explorer"},"content":{"rendered":"<div>\n<h1>How To Print A Directory Tree From Windows Explorer<\/h1>\n<p><a href=\"http:\/\/www.watchingthenet.com\/how-to-print-a-directory-tree-from-windows-explorer.html\" target=\"_blank\">http:\/\/www.watchingthenet.com\/how-to-print-a-directory-tree-from-windows-explorer.html <\/a><\/p>\n<\/div>\n<div>\n<div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"winlogo.jpg\" src=\"http:\/\/www.watchingthenet.com\/wp-content\/uploads\/image\/winlogo.jpg\" width=\"127\" height=\"86\" align=\"right\" \/>Do you ever have a need to print the contents of a folder or entire directory tree in Windows XP or Vista?<\/p>\n<p>If you do, Microsoft has a\u00a0<a href=\"http:\/\/support.microsoft.com\/kb\/321379\">knowledge base<\/a>\u00a0article that will add &#8220;Print Directory&#8221; to Windows Explorer right click menu which will print the folder contents (or directory tree) that you are currently viewing.<\/p>\n<p>But the problem with Microsoft&#8217;s solution in Step 2 is that\u00a0<em>File Types \\ Advanced<\/em>\u00a0option in<em>Folder Options<\/em>\u00a0does not exist in Vista, and for XP you need to hack the registry to prevent the\u00a0Search Companion window from opening when you try to open the folder using Windows Explorer.<\/p>\n<p><!--more--><\/p>\n<p>FORGET THAT CRAP!<\/p>\n<p>Fortunantly there&#8217;s an easier way to use this feature without messing around in the registry or searching all day for the Advanced button that doesn&#8217;t exist.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>To do this, we&#8217;ll use Step 1 as described in the knowledge base article, and create the batch file which will include the commands needed for printing.<\/p>\n<h2>Creating The Printdir Batch File<\/h2>\n<ul>\n<li>Open Notepad by clicking on\u00a0<em>Start \\ Run<\/em>\u00a0and enter\u00a0<em>notepad<\/em>\u00a0in the Run dialog box and click\u00a0<em>OK<\/em>.<\/li>\n<li>Copy and paste the following text into Notepad:<\/li>\n<\/ul>\n<div>@echo off<br \/>\ndir %1 \/-p \/o:gn &gt; &#8220;%temp%\\Listing&#8221;<br \/>\nstart \/w notepad \/p &#8220;%temp%\\Listing&#8221;<br \/>\ndel &#8220;%temp%\\Listing&#8221;<br \/>\nexit<\/div>\n<ul>\n<li>Close Notepad and click\u00a0<em>Yes<\/em>\u00a0to save the changes.<\/li>\n<li>In the\u00a0<em>Save As\u00a0<\/em>dialog box, copy and paste the following text\u00a0in the\u00a0<em>File name:<\/em>\u00a0field(shown in below screen shot):<\/li>\n<\/ul>\n<p>%windir%\\Printdir.bat<\/p>\n<ul>\n<li>Select All Files (*.*) in the Save as type: drop down field. Then Click Save.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"winprintdirtree2.png\" src=\"http:\/\/www.watchingthenet.com\/wp-content\/uploads\/image\/winprintdirtree2.png\" width=\"341\" height=\"87\" align=\"bottom\" \/><\/p>\n<p>The Printdir.bat file has now been saved in the \\Windows folder.<\/p>\n<p>&nbsp;<\/p>\n<p>Next, we&#8217;ll need create a shortcut to the Printdir.bat file in the\u00a0<em>Send To<\/em>\u00a0folder.<\/p>\n<h2>Create Printdir Shortcut<\/h2>\n<ul>\n<li>In\u00a0<strong>Vista<\/strong>, click on\u00a0<em>Start \\ Run<\/em>\u00a0and enter\u00a0the following in the\u00a0<em>Run<\/em>\u00a0dialog box and click\u00a0<em>OK<\/em><\/li>\n<\/ul>\n<p><strong><em>%APPDATA%\\Microsoft\\Windows\\SendTo<\/em><\/strong><\/p>\n<p>(<em><strong>NOTE:<\/strong>\u00a0%APPDATA%\u00a0<\/em>is an environment variable that points to your<em>\u00a0<\/em>user name<em>AppData\\Roaming\u00a0<\/em>folder).<\/p>\n<ul>\n<li>In\u00a0<strong>XP<\/strong>,\u00a0click on\u00a0<em>Start \\ Run<\/em>\u00a0and enter the following\u00a0in the Run dialog box and click\u00a0<em>OK<\/em>(<em>%USERPROFILE%\u00a0<\/em>is an environment variable that points to your use name<em>\u00a0Documents and Settings folder<\/em>).<\/li>\n<\/ul>\n<p><em><strong>%USERPROFILE%\\SendTo<\/strong><\/em><\/p>\n<ul>\n<li>In the SendTo folder, right click and select\u00a0<em>New \\ Shortcut.<\/em><\/li>\n<li>Type\u00a0<strong><em>%windir%\\Printdir.bat<\/em><\/strong>\u00a0in the &#8220;<em>Type the location of the item:<\/em>&#8221; field and click<em>Next<\/em>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"winprintdirtree3.png\" src=\"http:\/\/www.watchingthenet.com\/wp-content\/uploads\/image\/winprintdirtree3.png\" width=\"458\" height=\"346\" align=\"bottom\" \/><\/p>\n<ul>\n<li>Type\u00a0<em>Print Directory Listing<\/em>\u00a0in the &#8220;<em>Type a name for this shortcut<\/em>&#8221; and click\u00a0<em>Finish<\/em>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"winprintdirtree4.png\" src=\"http:\/\/www.watchingthenet.com\/wp-content\/uploads\/image\/winprintdirtree4.png\" width=\"492\" height=\"370\" align=\"bottom\" \/><\/p>\n<p>Now when you have the need to print a directory tree of folder contents from Windows Explorer, just right click and select Send To \\\u00a0Print Directory Listing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"winprintdirtree5.png\" src=\"http:\/\/www.watchingthenet.com\/wp-content\/uploads\/image\/winprintdirtree5.png\" width=\"247\" height=\"201\" align=\"bottom\" \/><\/p>\n<p>Much better than mucking around in the registry!<\/p>\n<h3>Hey What About Printing From The Command Prompt?<\/h3>\n<p>Yea, if you like to work at the command prompt, you can just type\u00a0<em>printdir.bat<\/em>\u00a0(if you created the batch file) at the prompt or enter the following command:<\/p>\n<p>dir \/-p \/o:gn &gt; %temp%\\Listing | start \/w notepad \/p %temp%\\Listing<\/p>\n<p>The command is similar to what we used in the Printdir.bat file, except were &#8220;piping&#8221; the command together with the &#8220;|&#8221; character (found above the Enter key and holding Shift down).<\/p>\n<p>By using &#8220;|&#8221; (SHIFT+\\ above Enter key), it allows you to execute two commands at once. Every time you execute, it will over write the file &#8220;Listing&#8221; so you don&#8217;t need to worry about deleting it.<\/p>\n<p>Cool!<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How To Print A Directory Tree From Windows Explorer http:\/\/www.watchingthenet.com\/how-to-print-a-directory-tree-from-windows-explorer.html Do you ever have a need to print the contents of a folder or entire directory tree in Windows XP or Vista? If you do, Microsoft has a\u00a0knowledge base\u00a0article that &#8230; <a class=\"more-link\" href=\"http:\/\/www.wildow.com\/blog\/?p=1269\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1269","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1269"}],"version-history":[{"count":1,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1269\/revisions"}],"predecessor-version":[{"id":1270,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1269\/revisions\/1270"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1269"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}