| Windows 7: Directory List |
02 Sep 2009
|
#1 | | |
Directory List There was a command prompt in winXP that would create a txt file with a list of directories, sub-directories and files for any given path. The prompt looked like this:
DIR "I:\" /s > "C:\List.txt"
There was something similar in Vista but I never did get the format needed that would work. I know it looked somthing lke this:
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
There must be something like this in win 7, just wondering if anyone may know what it is.
I know that Karen has a free program that does close to what I want but the command prompt did exactly what I want.
Thanks
Last edited by Dwarf; 04 Sep 2009 at 02:33 PM..
| My System Specs |
| OS Windows 7 Pro CPU Intel(R) Pentium(R) Duel CPU E2200 2.20 Ghz Motherboard GA-G41M-ES2L Memory 4 gb 2.96 Usable Graphics Card Onboard Sound Card Onboard Hard Drives 2 - 1TB WD Sata Drives |
02 Sep 2009
|
#2 | | Win 8 Release candidate 8400 |

Quote: Originally Posted by huffman There was a command prompt in winXP that would create a txt file with a list of directories, sub-directories and files for any given path. The prompt looked like this:
DIR "I:\" /s > "C:\List.txt"
There was something similar in Vista but I never did get the format needed that would work. I know it looked somthing lke this:
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
There must be something like this in win 7, just wondering if anyone may know what it is.
I know that Karen has a free program that does close to what I want but the command prompt did exactly what I want.
Thanks
Maybe its not a funtion of the dir command but of the path variable. The above dir works and ouputs to a text file. what is it not doing that you want it to do?
Ken | My System Specs | | System Manufacturer/Model Number HP Pavillion dv-7 1005 Tx OS Win 8 Release candidate 8400 CPU 2@2.4 Memory 4 gigs Graphics Card Nvidia 9600M Sound Card HD built-in Monitor(s) Displays 17" Wxga Screen Resolution 1440x900 Cooling none Internet Speed 45Mb down 5Mb up |
02 Sep 2009
|
#3 | | Windows 7 Ultimate x64 + x86 + Windows 8 x64 Newport, South Wales, UK |
Full syntax for the dir command is available with the dir /? entry Code: C:\Windows\system32>dir /?
Displays a list of files and subdirectories in a directory.
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]
[drive:][path][filename]
Specifies drive, directory, and/or files to list.
/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files I Not content indexed files
L Reparse Points - Prefix meaning not
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the
default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/R Display alternate data streams of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4 Displays four-digit years
Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W. as you say adding the pipe >file.txt will send the output to a file | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number Real World Computing (Me + a little help from Acer) OS Windows 7 Ultimate x64 + x86 + Windows 8 x64 CPU AMD Phenom II X6 1035T 2.6 GHz Motherboard Aspire M3400 Memory 4Gb PC10600 DDR3 1333 MHz Graphics Card NVIDIA GeForce 315 512MB Sound Card OnBoard - Realtek High Definition Audio Monitor(s) Displays Philips 32" HDTV, (HDMI) + 26" TV (VGA) Screen Resolution 1920 x 1080 @60Hz + 1360 x 768 @60Hz Keyboard Microsoft Wireless 800 or Stock Acer, (depends where I sit) Mouse Microsoft Wireless 800 or Stock Acer, (depends where I sit) PSU Stock (400W) Case Acer M3400 Cooling Stock Hard Drives 500 GB Seagate ST3500418AS SATA II
1 TB Hitachi HDS5C1010CLA382 SATAII
1 TB Samsung Spinpoint F1 HD103SI SATA II (external)
Plus various other (client ) HDDs as needed Internet Speed Temporaray 3G Dongle Antivirus Avast Browser Chrome Other Info USB Capture + Webcam(s) Bamboo Digitizer tablet
Also run Acer AspireOne 530h Netbook, Dual Core Atom + 1GB (Win7 Ult x86) Plus various test systems for new projects |
02 Sep 2009
|
#4 | | Windows 7 x64 Ultimate A Finnish immigrant in Leipzig, Germany |
You have to use Command Promp as an administrator to do this in Windows 7. - Run Command Prompt as an Administrator
- type dir /s > C:\Test.txt, this creates a text file Test.txt onto the root of drive C:
Kari | My System Specs | | Computer type Laptop System Manufacturer/Model Number HP ENVY 17-1150eg OS Windows 7 x64 Ultimate CPU 1.6 GHz Intel Core i7-720QM Processor Memory 6 GB Graphics Card ATI Mobility Radeon HD 5850 Graphics Sound Card Beats sound system with integrated subwoofer Monitor(s) Displays 17" laptop display, 22" LCD and 32" Full HD TV through HDMI Screen Resolution 1600*900, 1680*1050 and 1920*1080 Keyboard Logitech diNovo Media Desktop Laser (bluetooth) Mouse Logitech MX1000 Laser (Bluetooth) Hard Drives Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media Internet Speed 50/10 Mbps VDSL Antivirus MSE, Windows Defender Browser Maxthon 3.5.2. Other Info Windows 7 Ultimate Retail Full in English, additional Guest-user accounts in Finnish, German and Swedish (Working languages English & Swedish, Family language German, my own language, mother tongue, Finnish. I really need Ultimate to get to use Language Packs!) |
02 Sep 2009
|
#5 | | |
The commands are still the same as they were in XP. | My System Specs | | System Manufacturer/Model Number Alienware Aurora ALX R4 OS Windows 7 x64 (SP1) CPU Intel Core i7-3930K (3.2GHz, Turbo 4GHz) Motherboard Alienware Aurora-R4 x79 Memory 4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz) Graphics Card Nvidia Geforce GTX 690 (Stock) Sound Card RealTek Integrated Audio Monitor(s) Displays Dell UltraSharp U3011 Screen Resolution 2560x1600 Other Info Dell Inspiron Mini 10v (Intel Atom N270 1.6 GHz; 1GB; Windows 7 Ultimate) |
03 Sep 2009
|
#6 | | Windows 7 Ult x64(x2), HomePrem x32(x4), Server 08 (+VM), 08 R2 (VM) , SuSe 11.2 (VM), XP 32 (VM) In a ∞ Portal |
still works...
and if you want to store in the root your of the C drive you need to run as admin.... 
what error are you getting?
Last edited by darkassain; 03 Sep 2009 at 04:55 AM..
| My System Specs | | System Manufacturer/Model Number Tx2500z Tablet Pc/Homemade Server OS Windows 7 Ult x64(x2), HomePrem x32(x4), Server 08 (+VM), 08 R2 (VM) , SuSe 11.2 (VM), XP 32 (VM) CPU Turion X2 ultra (oh well came with laptop)/P4 @3.2 (yes P4) Motherboard IDK HP Motherboard / Intel DG965SS Memory OCZ Dual Channel 4GB kit/ 1gb Dual Channel Graphics Card HD 3200 graphics /GMA x3100 (yay for intergrated!!) Sound Card Realtek HD Audio(mic working, well sort of)/Siig IC-70012 Monitor(s) Displays built-in Hp 12" laptop screen/ Acer 19" Screen Resolution 1280x800 /1440x900 Mouse Logi MX Rev. /MS Wheel Optical 1.1A /Logitech Optical Mouse Cooling All Air Cooled Internet Speed College baby but its still routed through vpn to 1536k... Other Info love my wacom pen and pressure sensitivity...
wished it worked in 7, SUSE for that matter though |
03 Sep 2009
|
#7 | | Windows 7 x64 Ultimate A Finnish immigrant in Leipzig, Germany |

Quote: Originally Posted by logicearth The commands are still the same as they were in XP. Yes, that's true, though in Windows 7 you have to use administrative rights to use some of the features, like the pipe. | My System Specs | | Computer type Laptop System Manufacturer/Model Number HP ENVY 17-1150eg OS Windows 7 x64 Ultimate CPU 1.6 GHz Intel Core i7-720QM Processor Memory 6 GB Graphics Card ATI Mobility Radeon HD 5850 Graphics Sound Card Beats sound system with integrated subwoofer Monitor(s) Displays 17" laptop display, 22" LCD and 32" Full HD TV through HDMI Screen Resolution 1600*900, 1680*1050 and 1920*1080 Keyboard Logitech diNovo Media Desktop Laser (bluetooth) Mouse Logitech MX1000 Laser (Bluetooth) Hard Drives Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media Internet Speed 50/10 Mbps VDSL Antivirus MSE, Windows Defender Browser Maxthon 3.5.2. Other Info Windows 7 Ultimate Retail Full in English, additional Guest-user accounts in Finnish, German and Swedish (Working languages English & Swedish, Family language German, my own language, mother tongue, Finnish. I really need Ultimate to get to use Language Packs!) |
03 Sep 2009
|
#8 | | |
OK ran prompt command as administrator and the put in the following prompt:
DIR E:\data\" /s > "C:\List.txt"
This should have created a text file on Cdrive with the files in E:\data listed.
No List.txt was created on C drive unless it was hidden somewhere.
LOL driving me nuts | My System Specs | | OS Windows 7 Pro CPU Intel(R) Pentium(R) Duel CPU E2200 2.20 Ghz Motherboard GA-G41M-ES2L Memory 4 gb 2.96 Usable Graphics Card Onboard Sound Card Onboard Hard Drives 2 - 1TB WD Sata Drives |
03 Sep 2009
|
#9 | | Windows 7 x64 Ultimate A Finnish immigrant in Leipzig, Germany |

Quote: Originally Posted by huffman OK ran prompt command as administrator and the put in the following prompt:
DIR E:\data\" /s > "C:\List.txt"
This should have created a text file on Cdrive with the files in E:\data listed.
No List.txt was created on C drive unless it was hidden somewhere.
LOL driving me nuts Hope you didn't type your command exactly like this; there should be no quotation marks around the output file name. Also the quotation mark after E:\data\ should not be there.
No quotation marks! It works, 100% guaranteed.
Kari | My System Specs | | Computer type Laptop System Manufacturer/Model Number HP ENVY 17-1150eg OS Windows 7 x64 Ultimate CPU 1.6 GHz Intel Core i7-720QM Processor Memory 6 GB Graphics Card ATI Mobility Radeon HD 5850 Graphics Sound Card Beats sound system with integrated subwoofer Monitor(s) Displays 17" laptop display, 22" LCD and 32" Full HD TV through HDMI Screen Resolution 1600*900, 1680*1050 and 1920*1080 Keyboard Logitech diNovo Media Desktop Laser (bluetooth) Mouse Logitech MX1000 Laser (Bluetooth) Hard Drives Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media Internet Speed 50/10 Mbps VDSL Antivirus MSE, Windows Defender Browser Maxthon 3.5.2. Other Info Windows 7 Ultimate Retail Full in English, additional Guest-user accounts in Finnish, German and Swedish (Working languages English & Swedish, Family language German, my own language, mother tongue, Finnish. I really need Ultimate to get to use Language Packs!) |
03 Sep 2009
|
#10 | | XP_Pro, W7_7201, W7RC.vhd, SciLinux5.3, Fedora12, Fedora9_2x, OpenSolaris_09-06 Denver suburb |

Quote: Originally Posted by Kari Hope you didn't type your command exactly like this; there should be no quotation marks around the output file name. Also the quotation mark after E:\data\ should not be there.
No quotation marks! It works, 100% guaranteed.
Kari Righto!
The real problem is the odd nbr of quote-marks.
Should be even, to complete the command-line 'parsing', if he's really into 'quote-marks'...
Chances are, that this isn't nec. either:
DIR E:\data \ /s > C:\List.txt
The /h option is good too, if he wants to see hidden files... | My System Specs | | System Manufacturer/Model Number Gateway GT5056 OS XP_Pro, W7_7201, W7RC.vhd, SciLinux5.3, Fedora12, Fedora9_2x, OpenSolaris_09-06 CPU AMD 64x2 Motherboard Yes Memory 1 gig Graphics Card Dunno Sound Card Realtek something Monitor(s) Displays Samsung SyncMaster 940MW w/TV Screen Resolution 1280x1024 Hard Drives 250 GB WD, USB Seagate Freedesk 1.5 T Internet Speed Cable modem Other Info 1 + 1 = 10b,
7 + 7 = 16o,
a + b = 15h. All times are GMT -5. The time now is 12:28 AM. | |