### Insights on Writing BAT Files
1. **doslfn**
The cp936uni.tbl of doslfn can support the display of Chinese long filenames, but if it is called using the lh command, it will not support Chinese.
2. **pc-cache**
A small tool in pctools90 includes three basic components: pc-cache.com / pc-ex2x.ovl / pc-wnerr.ov. During the startup process, excessive memory usage may cause the hard disk or even the floppy drive to fail to read data normally. You can load himem.sys in config.sys and add the pc-cache command to the starting statement in autoexec.bat to pre-allocate sufficient cache for each drive. For example: pc-cache sizext:5120 /write
n. The pc-cache.com can be compressed by pklite by 28%.
3. **diskgen**
Many people like to use the diskgen partition software, but I found that if the memory is not loaded properly, this software cannot be used. My experience tells me that if dos=high is set in config.sys, it is very easy to get a system crash when running diskgen. If set to dos=low, it will be much better.
4. **Menus**
Many people use various menu editors to call batch programs. In fact, there is a very good internal function instruction in ndos/4dos that can complete menu editing, and the generated menu is in the form of a scrolling bright bar in the window, that is, countless options can be displayed in a small window.
%@select
The above function means to create a window in the area from x1, y1 to x2, y2, and the content of the text file is displayed in the window. The user can select a line of content in the text file through the "up and down" keys. When the user presses the Enter key, the function returns the content of the selected line to the environment. We can use the following example to illustrate:
There is a text file name, abc.txt, and the content is as follows:
1.dm
2.spfdisk
3.vc
4.ndd
5.exit
We can write the l.bat file with the following content to complete the menu selection purpose
@echo off
setlocal
:loop
cls
set ccc=%@select
if %ccc%*==1.dm* goto dm
if %ccc%*==2.spfdisk* goto spfdisk
if %ccc%*==3.vc* goto vc
if %ccc%*==4.ndd* goto ndd
if %ccc%*==5.exit* goto end
:dm
dm
goto loop
:spfdisk
spfdisk
goto loop
:vc
vc
goto loop
:ndd
ndd
goto loop
:end
cls
endlocal
When you need to run it, just run l under the ndos/4dos environment or run ndos/c l under the msdos environment.
5. **Regarding the Garbled Screen Problem of UCDOS in Windows**
In fact, this is the reason for the default screen display mode of UCDOS. We can modify the sentence "knl %2" in the ucdos.bat file to "knl vesa".
6. **Regarding ndos/4dos**
I also often use 4dos, but only recently did I start to feel that the stability of ndos is stronger than that of 4dos. Both 4dos and ndos are super easy-to-use shell programs used as shells. Some people react that ndos is too outdated and 4dos is too large. In fact, I have a good way to solve this problem. Usually, we will choose to use 4dos to replace command in msdos as the command shell. The reason why we do not use ndos is that ndos does not support long filenames. In fact, we can use the method of command + ndos to solve this problem. We can compress ndos with pklite. Generally, use the command of msdos as the startup shell. When ndos is needed, use the way of "ndos/c command" to temporarily use ndos as the secondary shell. In addition, the purpose of us using doslfn to display long filenames is nothing more than to view/copy/move/delete files, etc. Although ndos does not support long filenames, after running doslfn in the ndos state, we can operate long filename files through the vc software.
As the saying goes, "different people like different things". The volume of 4dos is much larger than (command.com + compressed ndos.com). And if 4dos is compressed with pklit and then used as a shell, it will be unstable.
7. **Regarding the Realization Method of Displaying a Small Number of Chinese Characters Without Entering the Chinese Character System**
There is a tool software called bt/bte, which not only has many bat enhancement functions (such as sound effects, short animations, enhanced judgment statements, etc.), but also provides a way to display a small number of Chinese characters without entering the Chinese character system, which is the bt program. It can compile the Chinese characters to be used in advance into a program. When this font library program is executed, it will modify the character patterns of ASCII codes 128 ̄255. Up to 64 Chinese characters. This is sufficient for writing general bat files. Download address: http://zql3322.3322.net in the dos tools.
The Chinese characters in my ghost2003 tool disk are made with this tool (because of the floppy disk space limit, it is impossible to put the Chinese character system in).
2003.6.13 DOS Era Novice http://zql3322.3322.net Cabin Consultant
1. **doslfn**
The cp936uni.tbl of doslfn can support the display of Chinese long filenames, but if it is called using the lh command, it will not support Chinese.
2. **pc-cache**
A small tool in pctools90 includes three basic components: pc-cache.com / pc-ex2x.ovl / pc-wnerr.ov. During the startup process, excessive memory usage may cause the hard disk or even the floppy drive to fail to read data normally. You can load himem.sys in config.sys and add the pc-cache command to the starting statement in autoexec.bat to pre-allocate sufficient cache for each drive. For example: pc-cache sizext:5120 /write
n. The pc-cache.com can be compressed by pklite by 28%.3. **diskgen**
Many people like to use the diskgen partition software, but I found that if the memory is not loaded properly, this software cannot be used. My experience tells me that if dos=high is set in config.sys, it is very easy to get a system crash when running diskgen. If set to dos=low, it will be much better.
4. **Menus**
Many people use various menu editors to call batch programs. In fact, there is a very good internal function instruction in ndos/4dos that can complete menu editing, and the generated menu is in the form of a scrolling bright bar in the window, that is, countless options can be displayed in a small window.
%@select
The above function means to create a window in the area from x1, y1 to x2, y2, and the content of the text file is displayed in the window. The user can select a line of content in the text file through the "up and down" keys. When the user presses the Enter key, the function returns the content of the selected line to the environment. We can use the following example to illustrate:
There is a text file name, abc.txt, and the content is as follows:
1.dm
2.spfdisk
3.vc
4.ndd
5.exit
We can write the l.bat file with the following content to complete the menu selection purpose
@echo off
setlocal
:loop
cls
set ccc=%@select
if %ccc%*==1.dm* goto dm
if %ccc%*==2.spfdisk* goto spfdisk
if %ccc%*==3.vc* goto vc
if %ccc%*==4.ndd* goto ndd
if %ccc%*==5.exit* goto end
:dm
dm
goto loop
:spfdisk
spfdisk
goto loop
:vc
vc
goto loop
:ndd
ndd
goto loop
:end
cls
endlocal
When you need to run it, just run l under the ndos/4dos environment or run ndos/c l under the msdos environment.
5. **Regarding the Garbled Screen Problem of UCDOS in Windows**
In fact, this is the reason for the default screen display mode of UCDOS. We can modify the sentence "knl %2" in the ucdos.bat file to "knl vesa".
6. **Regarding ndos/4dos**
I also often use 4dos, but only recently did I start to feel that the stability of ndos is stronger than that of 4dos. Both 4dos and ndos are super easy-to-use shell programs used as shells. Some people react that ndos is too outdated and 4dos is too large. In fact, I have a good way to solve this problem. Usually, we will choose to use 4dos to replace command in msdos as the command shell. The reason why we do not use ndos is that ndos does not support long filenames. In fact, we can use the method of command + ndos to solve this problem. We can compress ndos with pklite. Generally, use the command of msdos as the startup shell. When ndos is needed, use the way of "ndos/c command" to temporarily use ndos as the secondary shell. In addition, the purpose of us using doslfn to display long filenames is nothing more than to view/copy/move/delete files, etc. Although ndos does not support long filenames, after running doslfn in the ndos state, we can operate long filename files through the vc software.
As the saying goes, "different people like different things". The volume of 4dos is much larger than (command.com + compressed ndos.com). And if 4dos is compressed with pklit and then used as a shell, it will be unstable.
7. **Regarding the Realization Method of Displaying a Small Number of Chinese Characters Without Entering the Chinese Character System**
There is a tool software called bt/bte, which not only has many bat enhancement functions (such as sound effects, short animations, enhanced judgment statements, etc.), but also provides a way to display a small number of Chinese characters without entering the Chinese character system, which is the bt program. It can compile the Chinese characters to be used in advance into a program. When this font library program is executed, it will modify the character patterns of ASCII codes 128 ̄255. Up to 64 Chinese characters. This is sufficient for writing general bat files. Download address: http://zql3322.3322.net in the dos tools.
The Chinese characters in my ghost2003 tool disk are made with this tool (because of the floppy disk space limit, it is impossible to put the Chinese character system in).
2003.6.13 DOS Era Novice http://zql3322.3322.net Cabin Consultant
我是女孩,我怕谁?


