China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 05:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Please write a batch file that displays the contents of all BAT and TXT files View 879 Replies 6
Original Poster Posted 2008-07-23 19:28 ·  中国 天津 联通
高级用户
★★
Credits 687
Posts 222
Joined 2005-08-21 22:37
20-year member
UID 41842
Status Offline
mode *.bat *.txt

When the screen is full, it needs to wait page by page. I wonder whether type can pause page by page?
Floor 2 Posted 2008-07-23 19:35 ·  中国 湖北 武汉 联通
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
type won't work, try more *.bat *.txt, but this has a small bug: it will be fine as long as your folder names don't end with .bat or .txt.
Floor 3 Posted 2008-07-23 19:52 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Floor 4 Posted 2008-07-23 21:56 ·  中国 天津 联通
高级用户
★★
Credits 687
Posts 222
Joined 2005-08-21 22:37
20-year member
UID 41842
Status Offline
Windows ME MS-DOS screen output

F:\RAR>type cc.bat
@echo off
for /f "delims=/" %%a in ('dir /s /b *.bat *.txt') do (
more "%%a"
)

F:\RAR>cc
Syntax error
Invalid file name in command line
Bad command or file name


F:\RAR>dir *.bat

Volume in drive F is Local Disk
Volume Serial Number is 0D38-1BF9
Directory of F:\RAR

M BAT 53 09-18-05 0:00 M.bat
CC BAT 83 07-23-08 21:43 cc.bat
2 file(s) 136 bytes
Floor 5 Posted 2008-07-23 21:57 ·  中国 天津 联通
高级用户
★★
Credits 687
Posts 222
Joined 2005-08-21 22:37
20-year member
UID 41842
Status Offline
FOR %%C IN (*.BAT *.TXT) DO MORE < %%C (error: File not found)

FOR %%C IN (*.BAT *.TXT) DO TYPE %%C | MORE (when the screen is full it doesn't wait)


When the screen is full, it needs to wait page by page. It would be best if there were separators between different *.TXT files too. ******* is fine, C:\> is fine, three blank lines are fine too.
Floor 6 Posted 2008-07-23 22:50 ·  中国 重庆 九龙坡区 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
I don't have a WinME environment, so I can't test it.
There is no problem in WinXP.
Floor 7 Posted 2008-07-24 00:43 ·  中国 天津 宝坻区 联通
高级用户
★★
Credits 687
Posts 222
Joined 2005-08-21 22:37
20-year member
UID 41842
Status Offline
Originally posted by HAT at 22:50:
I don't have a WinME environment, so I can't test it.
There is no problem in WinXP.

Thanks anyway for your warm help.
Forum Jump: