中国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-09-06 09:53
47,812 topics / 349,914 posts / today 0 new / 48,268 members
DOS启动盘 & LOGO技术 (启动盘室) » [Discussion] About the problem of slimming down COMMAND.COM
Printable Version  2,976 / 19
Floor1 Wengier Posted 2003-06-03 00:00
系统支持 Posts 10,521 Credits 27,736
The necessary files such as COMMAND.COM in MS-DOS 7.x are relatively large and occupy quite a bit of space, so they should be slimmed down properly. However, software like UPX, aPack, etc., cannot compress it. And the result of compression with COMPREXE is that it can run but cannot be used as a SHELL; otherwise, an "Invalid COMMAND.COM" error will occur.

I observed and found that COMMAND.COM can currently be reduced by at most 2 bytes, not even 3 bytes. It is also possible to add bytes or modify the original bytes, but just cannot reduce by more than 2 bytes. Obviously, COMMAND.COM will perform a volume check when acting as a SHELL, and it won't work if it is less than 94,290 bytes. Does anyone have a way to solve this?
Floor2 minisheep Posted 2003-06-03 00:00
高级用户 Posts 233 Credits 830
From a cracking perspective! He is checking his own size, right! You don't let him check! He uses conditional statements! You use unconditional statements! Then change the size to the size you modified! Don't look at me with an adoring eye! I just know the principle! I don't know the method!
Floor3 如是大师 Posted 2003-06-03 00:00
元老会员 Posts 3,351 Credits 9,654 From 湖北
Haha.....I can say it too. Who will come to worship me.....
Floor4 Wengier Posted 2003-06-04 00:00
系统支持 Posts 10,521 Credits 27,736
Experts like Roy, lydong, etc., also come and share the methods.
Floor5 9zhmke Posted 2003-06-05 00:00
中级用户 Posts 99 Credits 355
There was a game before that needed to play a movie file larger than 10M. As a result, when I checked the executable file, there were only two places at 10M. The first time it wasn't right, the second time..... From then on, that game could be played on the hard drive.

............Give it a try.
Floor6 Wengier Posted 2003-06-13 00:00
系统支持 Posts 10,521 Credits 27,736
Just now I did some research on COMMAND.COM and found that it's really not easy to drastically streamline COMMAND.COM, unless some major modifications are made. Because COMMAND.COM directly accesses the internal addresses of files, unlike ordinary programs. For example, by modifying the 5F10H position in COMMAND.COM, at least tens of bytes of content in COMMAND.COM can be reduced, but to streamline further, more content in COMMAND.COM needs to be modified. I hope everyone can work together.
Floor7 dos时代菜鸟 Posted 2003-06-13 00:00
初级用户 Posts 216 Credits 672
The command program is just an external command parsing program. Why can't we replace it with others? For example, ndos
Floor8 Wengier Posted 2003-06-13 00:00
系统支持 Posts 10,521 Credits 27,736
The following is a quote from dos era rookie on 2003-6-13 9:26:29:
The COMMAND program is just an external command parsing program. Why can't we replace it with others? For example, NDOS


Because NDOS and others do not support long filenames. However, COMMAND in MS-DOS 7.10 fully supports long filenames under DOSLFN and has good compatibility.
Floor9 Roy Posted 2003-06-13 00:00
管理员 Posts 1,633 Credits 4,869
Use the COMMAND.COM of ROM-DOS
Floor10 Wengier Posted 2003-06-13 00:00
系统支持 Posts 10,521 Credits 27,736
The following is a quote from Roy at 2003-6-13 15:35:51:
Use the COMMAND.COM of ROM-DOS


There are some problems with the cooperation between COMMAND.COM of ROM-DOS and MS-DOS 7.10, and it does not support commands like LOCK.
Floor11 沈洁 Posted 2003-06-13 00:00
金牌会员 Posts 1,812 Credits 4,590 From 上海市
The new logo of moderator Wengier is quite beautiful!
It's a pity why a boy would choose a girl's avatar as the logo,
In comparison, the avatars of Roy and Master Rushiyou are more manly!
Floor12 沈洁 Posted 2003-06-13 00:00
金牌会员 Posts 1,812 Credits 4,590 From 上海市
And also hope that moderator Wengier can successfully compress command!
Floor13 Lydong Posted 2003-06-14 00:00
元老会员 Posts 407 Credits 1,468 From 广州
The following is a quote from Wengier on 2003-6-4 19:36:34:
Experts like Roy, lydong, etc., also come and share some methods.

Being called a "expert" by Wengier really makes me feel unworthy (a bit embarrassed)! In the forum, I mainly am still learning from everyone. Although I am very interested in researching DOS-related issues with everyone, my own knowledge is superficial, and I really don't dare to be in the "expert" category (a bit ashamed)...

Regarding the problem mentioned above, I think whether COMMAND.COM can also be divided into several segments like when streamlining IO.SYS, and some unimportant contents can be removed to achieve streamlining. Secondly, the program that checks the size of COMMAND.COM should be in IO.SYS, because when other SHELLs are replaced, there will be the same error prompt. The problem should not be with COMMAND.COM itself. Instead, it is the check by IO.SYS on the size of COMMAND.COM that causes the issue. I don't know if what I said is correct. Please give me your advice, Wengier!
Floor14 Wengier Posted 2003-06-14 00:00
系统支持 Posts 10,521 Credits 27,736
The following is a quote from lydong on 2003-6-14 4:19:17:
   Among the problems mentioned above, I wonder if COMMAND.COM can also be divided into several segments like when slimming down IO.SYS, and some unimportant contents removed to achieve slimming. Secondly, the program to check the size of COMMAND.COM should be in IO.SYS, because when replacing with other SHELLs, there will be the same error prompt, the problem should not be with COMMAND.COM itself. Instead, it is the check of the size of COMMAND.COM by IO.SYS that causes the problem. I don't know if it's right. Please give your instructions, Wengier!


Alas, it's not like that. As I observed, the structures of IO.SYS and COMMAND.COM are completely different, so the previous experience of slimming down IO.SYS cannot be applied to COMMAND.COM. What was done to IO.SYS is slimming, while for COMMAND.COM it can only be compressed. But the size check is not in IO.SYS, but inside COMMAND.COM, which has been confirmed by my research and experiments, but there is currently no good solution.
Floor15 沈洁 Posted 2003-06-14 00:00
金牌会员 Posts 1,812 Credits 4,590 From 上海市
This is troublesome. First, compress it to know the volume after compression, then modify the address of the annotation file volume in the uncompressed command, and finally compress this program again in the same way! It's really troublesome!
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023