『楼 主』:
我的一点经验,不足之处大家执教
使用 LLM 解释/回答一下
关于bat编写的心得
1.doslfn
doslfn 的 cp936uni.tbl 可以支持中文长文件名称的显示,但是如果将其用
lh 命令调用,就不会支持汉语.
2.pc-cache
pctools90中的一个小工具包括三个基本组件:
pc-cache.com / pc-ex2x.ovl / pc-wnerr.ov.
在启动过程中可能会因为内存的过量使用造成硬盘甚至软驱无法正常读取数据,
可以在config.sys中加载 himem.sys 并把 pc-cache 指令加到在autoexec.bat
的起始语句,事先分配各个驱动器足够的缓存.
比如: pc-cache sizext:5120 /write<img src="images/smilies/face-surprise.png" align="absmiddle" border="0">n
pc-cache.com 可以用pklite压缩掉28%
3.diskgen
很多人都喜欢使用diskgen这个分区软件,但是我发现如果加载内存不当,就无法使
用这个软件,我的经验告诉我,如果在config.sys中设置dos=high就很容易出现运行
diskgen时死机.如果设为dos=low就会好的多.
4.菜单
不少人使用各种调用批处理程序的菜单编辑器,其实ndos/4dos中就有一个很好的
内部函数指令可以完成菜单的编辑,而且生成的菜单还是窗口中滚动光亮条形式的,
也就是说可以在小窗口中显示无数条选项.
%@select
上面的函数意思是在x1,y1到x2,y2的区域建立一个窗口,窗口中显示文本文件的内容
用户可以通过"上下"键选择文本文件中的某一行内容,当用户按回车键的时候,函数
就把选定的一行的内容返回到环境中.我们可以用如下例子说明:
有文本文件名,为abc.txt,内容如下:
1.dm
2.spfdisk
3.vc
4.ndd
5.exit
我们可以编写如下内容的l.bat文件用来完成菜单选项目的
@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
需要运行的时候只要在ndos/4dos环境下运行 l 或者在 msdos环境下运行 ndos/c l
就可以了
5.关于ucdos在windows中显示花屏问题
其实这是ucdos默认屏幕显示模式的原因,我们可以把ucdos.bat文件中的 "knl %2"
一句修改为"knl vesa"就可以了.
6.关于ndos/4dos
我也经常使用4dos,只是在最近才开始感觉到ndos的稳定性要比4dos强.
4dos和ndos都是用来作为shell使用的超级好用的外壳程序.
有些人士反应ndos太过陈旧,而4dos又太过庞大,其实我有一个好办法,可以解决这
个问题通常我们都会选择使用4dos来代替msdos中的command作为 命令外壳,之所以
不使用ndos是因为ndos不支持长文件名,其实我们可以使用comamnd+ndos的办法解
决的, 我们可以把ndos用pklite压缩,一般用msdos的command作为启动外壳,等到需
要ndos的时候用"ndos/c 命令"的方式临时使用ndos作为次级 外壳.另外,我们使用
doslfn显示长文件名的目的无非是对文件进行查看/复制/移动/删除等操作,ndos虽
然不支持长文件名,但是在ndos状态下运行doslfn以后确可以通过vc这个软件对长文
件名文件进行操作.
正所谓"萝卜白菜各有所爱".4dos的体积要比(command.com+压缩后的ndos.com)大的多.
而且如果对4dos进行pklit压缩以后,再作为shell就会不稳定.
7.关于在不进入汉字系统的情况下显示少量汉字的实现方法
有一个工具软件叫做bt/bte,不但具有好多bat增强功能(比如音效,短小动画,判断语
句增强等等),同时还提供了不进入汉字系统显示少量汉字的途径就是 bt 程序,它可
以把预先要使用的汉字编入一个程序中,当执行这个字库程序的时候就会修改ASCII
码128 ̄255的字符字模.最多64个汉字.这对于编写一般的bat文件是足够了.下载地址:
http://zql3322.3322.net 中的dos工具.
我的ghost2003工具盘中的汉字就是用这个工具制作的(因为软盘空间限制,不可能将
汉字系统放进).
2003.6.13 dos时代菜鸟 http://zql3322.3322.net 小屋顾问
### 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:on. 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
|