![]() |
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-09 07:03 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » Please write a batch file that displays the contents of all BAT and TXT files |
| Printable Version 881 / 6 |
| Floor1 proof | Posted 2008-07-23 19:28 |
| 高级用户 Posts 222 Credits 687 | |
|
mode *.bat *.txt
When the screen is full, it needs to wait page by page. I wonder whether type can pause page by page? |
|
| Floor2 lxmxn | Posted 2008-07-23 19:35 |
| 版主 Posts 4,938 Credits 11,386 | |
|
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.
|
|
| Floor3 HAT | Posted 2008-07-23 19:52 |
| 版主 Posts 5,017 Credits 9,023 | |
| Floor4 proof | Posted 2008-07-23 21:56 |
| 高级用户 Posts 222 Credits 687 | |
|
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 |
|
| Floor5 proof | Posted 2008-07-23 21:57 |
| 高级用户 Posts 222 Credits 687 | |
|
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. |
|
| Floor6 HAT | Posted 2008-07-23 22:50 |
| 版主 Posts 5,017 Credits 9,023 | |
|
I don't have a WinME environment, so I can't test it.
There is no problem in WinXP. |
|
| Floor7 proof | Posted 2008-07-24 00:43 |
| 高级用户 Posts 222 Credits 687 | |
Originally posted by HAT at 22:50: Thanks anyway for your warm help. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |