中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-29 08:05
47,816 topics / 349,916 posts / today 0 new / 48,265 members
DOS批处理 & 脚本技术(批处理室) » Excuse me, how to use the command to list the names of the folders under a folder!
Printable Version  3,039 / 8
Floor1 yaoguof Posted 2006-11-30 06:05
初级用户 Posts 35 Credits 90
There is a folder named 1 on drive D. Inside the 1 folder, there are 3 folders: 2, 3, and 4. What command can be used to list the name of each folder per line, with the purpose of comparing 2 folders? Thanks
Floor2 a9319751 Posted 2006-11-30 06:13
中级用户 Posts 170 Credits 439
C:\>dir /?
Displays a list of files and subdirectories in a directory.

DIR at
sortorder]]


Specifies the drive, directory

/A Displays files with specified attributes.
attributes D Directory
H Hidden file
S System file
/B Uses bare format (no header information or
/C Shows thousand separator in file sizes.
Disables separator display.
/D Same as wide but files are listed by columns
/L Uses lowercase.
/N New long list format where files
/O Lists files in sorted order.
sortorder N By name (alphabetically)
E By extension (alphabetically)
G Group directories first - Reverse
/P Pauses after each screenful of information.
/Q Displays file owner.
/S Displays specified directory and all subdirectories
/T Controls which time to display or use for sorting
timefield C Creation time
A Last access time
W Last write time
/W Uses wide list format.
/X Displays the short name generated for non 8dot3 filenames
The short name is inserted before the long name. If
displays blank.
/4 Uses four-digit year

You can predefine command options in the DIRCMD environment variable
to override the pre-set command options, for example, /-W.
Floor3 a9319751 Posted 2006-11-30 06:15
中级用户 Posts 170 Credits 439
C:\>dir /ad /b
WINNT
Documents and Settings
Program Files
Downloads
Inetpub
Recycled
Floor4 yaoguof Posted 2006-11-30 06:45
初级用户 Posts 35 Credits 90
Got it, thank you to the two above
Floor5 yaoguof Posted 2006-11-30 07:00
初级用户 Posts 35 Credits 90
I find that I'm still quite inexperienced. There's another question. There are many lines in a text. How to read one line of text each time, from the first line all the way to the last line!
Floor6 a9319751 Posted 2006-11-30 07:05
中级用户 Posts 170 Credits 439
Floor7 a9319751 Posted 2006-11-30 07:07
中级用户 Posts 170 Credits 439
对于 (1.txt) 中的每个 %%i 做....
Floor8 ccwan Posted 2006-11-30 07:09
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
Brothers and sisters, please try to search before asking questions. Maybe you can find the answer without asking;
Brothers and sisters, please try to be clear when answering questions. We rookies hope to get sincere help.

Thank you for your cooperation.
Floor9 ccwan Posted 2006-12-25 04:16
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
Bro, you don't need to follow up on every post. Everyone can see it.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023