View Full Version : Save File Listing to .txt File
Jack Mills
February 6th 04, 06:33 AM
How can I change the Printdir.bat code presented in
Microsoft Knowledge Base Article - 321379 so that the
list of folders is SAVED to My Documents so that I can
use the list in other applications? TIA
Ron Sommer
February 6th 04, 06:35 AM
Create the Dirlist.bat File
To create the Dirlist.bat file:
Click Start, click Run, type the following command, and then click OK:
notepad
Paste the following text into Notepad:
@echo off
dir %1 /o:gn > "C:\Documents and Settings\Owner\My Documents\Dirlist.txt"
exit
On the File menu, click Exit, and then click Yes to save the changes.
In the Save As dialog box, type the following text, and then click Save:
%windir%\Dirlist.bat
Create a New Action for File Folders
Click Start, click Control Panel (or, point to Settings, and then click
Control Panel), and then click Folder Options.
On the File Types tab, click File Folder.
Click Advanced, and then click New.
In the Action box, type:
Directory List
In the Application used to perform action box, type:
Dirlist.bat
Click OK.
Click OK, click OK, and then click Close.
--
Ron Sommer
"Jack Mills" > wrote in message
...
> How can I change the Printdir.bat code presented in
> Microsoft Knowledge Base Article - 321379 so that the
> list of folders is SAVED to My Documents so that I can
> use the list in other applications? TIA
Ron Sommer
February 6th 04, 06:40 AM
Create the Dirlist.bat File
To create the Dirlist.bat file:
Click Start, click Run, type the following command, and then click OK:
notepad
Paste the following text into Notepad:
@echo off
dir %1 /o:gn > "C:\Documents and Settings\Owner\My Documents\Dirlist.txt"
exit
On the File menu, click Exit, and then click Yes to save the changes.
In the Save As dialog box, type the following text, and then click Save:
%windir%\Dirlist.bat
Create a New Action for File Folders
Click Start, click Control Panel (or, point to Settings, and then click
Control Panel), and then click Folder Options.
On the File Types tab, click File Folder.
Click Advanced, and then click New.
In the Action box, type:
Directory List
In the Application used to perform action box, type:
Dirlist.bat
Click OK.
Click OK, click OK, and then click Close.
--
Ron Sommer
"Jack Mills" > wrote in message
...
> How can I change the Printdir.bat code presented in
> Microsoft Knowledge Base Article - 321379 so that the
> list of folders is SAVED to My Documents so that I can
> use the list in other applications? TIA
Hugh Eagle
February 6th 04, 06:41 AM
I think all you need to do is to replace
"%temp%\Listing"
in line 2 of Printdir.bat with
"%homepath%\My Documents\<your required filename>"
and delete lines 3 and 4
In this example Printdir.bat would read as follows:
@echo off
dir %1 /-p /o:gn > "%homepath%\My Documents\DirectoryListing.txt"
exit
Note: this should work if the "My Documents" folder is in its default
location within C:\Documents and Settings\..... However, if the Target
Folder for "My Documents" has been changed, you will need to
substitute the actual path (C:\Documents or whatever) in place of
%homepath%\My Documents.
I hope this is clear, and that it works!
> How can I change the Printdir.bat code presented in
> Microsoft Knowledge Base Article - 321379 so that the
> list of folders is SAVED to My Documents so that I can
> use the list in other applications? TIA
Hugh Eagle
February 6th 04, 06:41 AM
I think all you need to do is to replace
"%temp%\Listing"
in line 2 of Printdir.bat with
"%homepath%\My Documents\<your required filename>"
and delete lines 3 and 4
In this example Printdir.bat would read as follows:
@echo off
dir %1 /-p /o:gn > "%homepath%\My Documents\DirectoryListing.txt"
exit
Note: this should work if the "My Documents" folder is in its default
location within C:\Documents and Settings\..... However, if the Target
Folder for "My Documents" has been changed, you will need to
substitute the actual path (C:\Documents or whatever) in place of
%homepath%\My Documents.
I hope this is clear, and that it works!
> How can I change the Printdir.bat code presented in
> Microsoft Knowledge Base Article - 321379 so that the
> list of folders is SAVED to My Documents so that I can
> use the list in other applications? TIA
vBulletin® v3.6.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.