中国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 10:48
47,812 topics / 349,914 posts / today 0 new / 48,268 members
DOS启动盘 & LOGO技术 (启动盘室) » Discussion on the Method of Automatically Invoking Windows 98 on the Hard Disk After Booting from an MS-DOS 7.10 Floppy Disk
Printable Version  2,378 / 17
Floor1 dos时代菜鸟 Posted 2003-07-11 00:00
初级用户 Posts 216 Credits 672
The moderator's msdos710 boot disk is very useful, but if you want to run Windows 98 on the hard disk, you need to manually enter the Windows 98 installation path and run it. The little girl wrote a batch program of ndos to automatically call Windows 98 on the hard disk.

The working principle is as follows: The program first finds c:\msdos.sys, then checks each line of text in the msdos.sys file one by one in a loop. If the "WinDir=" statement is found, it is set as a variable and the loop is exited. According to the corresponding value of windir, the installation path of Windows 98 is found and Windows 98 is run.

Here, I'm just putting forward a simple idea, hoping that everyone will work hard. This program can also use xset instead of ndos to complete.

The following are several internal functions of ndos involved:
%@lines Used to return the number of lines of the file
%@line Used to return the content of the specified line of the file
%@len Used to return the length of the string
%@eval Used to return the result of +-*/ operations
%@substr Used to return n characters starting from the starting position of the string
%variable name% Returns the content of the variable

To run in the msdos710 environment, you can enter "ndos /c loadwin" to run

The content of the loadwin.bat program is as follows:
*********************************************
@echo off
setlocal
if not exist c:\msdos.sys goto error
set x=%@lines
set y=0
:loop
set winx1=%@line
if %y%*==%x%* goto error
set l=%@eval-7]
set winx=%@substr
if #%winx%#==#WinDir# goto setdir
set y=%@eval
goto loop

:setdir
set winx2=%@substr
set winx3=%@substr
%winx3%
cd %winx2%
path %winx2%;%winx2%\command
set x=
set y=
set l=
set winx1=
set winx2=
set winx3=
set winx=
WIN /D:N
:error
echo ERROR ! windows_9x_Path unknowed !!!
echo 1.THERE IS NOT C:\MSDOS.SYS!
ECHO 2.C:\MSDOS.SYS can not load Windows9x!
ECHO Press any key to continue!
PAUSE>NUL
goto end
:end
endlocal
quit
***************************************************
Floor2 Wengier Posted 2003-07-11 00:00
系统支持 Posts 10,521 Credits 27,736
I've read your post. I just wrote a FINDWIN.BAT batch program myself, specifically for directly and automatically searching all Win3.x/9x/Me on the hard disk under DOS (the kind that doesn't need the windir variable). Even if WIN.COM has been renamed (mine is), it can still find it. This batch program requires three files: STRINGS.COM, XFIND.EXE, and LOCATE.COM (all of which are in my MS-DOS 7.10 boot disk). And when it finds the search results, if there are more than one WIN in the hard disk, it will let the user choose the appropriate WIN to enter. However, since it's automatic search, the search speed is a bit slow, of course. The following is the content of the batch:

@echo off
set n=
set m=0
if exist verfiles.dat del verfiles.dat
if exist winfiles.dat del winfiles.dat
echo DOS-based Windows(Win3.x/9x/Me) Finder + Loader
echo.
echo Now searching for Windows on your hard drives...
locate win.ini /r /n /np > verfiles.dat
strings s=filesize verfiles.dat
if %s%==0 goto nowin
strings n=linesize verfiles.dat
strings n=add %n%,1
:loop
strings m=add %m%,1
strings s=read verfiles.dat,%m%
strings c=filedrive %s%
strings d=filedir %s%
xfind /C " ALT+ENTER " %c%%d%\*.com >> winfiles.dat
if %m%==%n% goto next
goto loop
:nowin
echo.
echo Warning: Can''''''''t find any possible Windows on your hard drives!
goto end
:wrong
echo Wrong input! Please reenter!
goto input
:next
strings n=linesize winfiles.dat
strings n=add %n%,1
set m=
strings m=sub %n%,10 > nul
if not %m%#==# echo Warning: Too many possible Windows found. Only first 9 will be shown.
if not %m%#==# set n=9
echo.
echo There are %n% possible Windows on your hard drives:
echo.
if %n%==1 strings s=read winfiles.dat,1
if %n%==1 goto start
set m=0
:read
strings m=add %m%,1
strings s=read winfiles.dat,%m%
echo %m%: %s%
if not %m%==%n% goto read
echo.
:input
set k=
set m=
echo Please enter the number of Windows you want to enter (1-%n%,ESC=Exit):
strings k=getkey
if %k%#==# goto end
if %k%==27 goto end
strings m=sub %k%,48 >nul
if %m%#==# goto wrong
if %m%#==0# goto wrong
set k=%m%
set m=
strings m=sub %n%,%k% >nul
if %m%#==# goto wrong
strings s=read winfiles.dat,%k%
if not exist %s% goto wrong
echo %k%
:start
strings c=filedrive %s%
strings d=filedir %s%
echo Now trying to start Windows from: %s%
pause
%c%
cd %d%
%s%
cd\
:end
echo.
echo Done.
echo.
if exist verfiles.dat del verfiles.dat
if exist winfiles.dat del winfiles.dat
set n=
set m=
set s=
set c=
set d=
set k=
rem Made by Wengier, China DOS Union. All rights reserved.

Welcome to put forward suggestions~~


Floor3 savioler Posted 2003-07-11 00:00
中级用户 Posts 136 Credits 422
OK, let me look into it first.
Floor4 如是大师 Posted 2003-07-11 00:00
元老会员 Posts 3,351 Credits 9,654 From 湖北
wengier is awesome..
Floor5 yiyesong Posted 2003-07-11 00:00
元老会员 Posts 632 Credits 1,987
Hehe, it seems a bit late to bring it up today. WENEIER wrote it too complicated.
Floor6 电吉入侵 Posted 2003-07-11 00:00
初级用户 Posts 377 Credits 1,480
Let me express my opinion:
I haven't understood the above batch processing yet....
Mine is boot from CD. After booting into Win, the virtual disk will disappear, so the boot disk can't boot into Win; now seeing your post, I wonder if it can be like this: The user must know whether there is Win on the machine. First check if there is msdos.sys in the root directory of drive C. If there is, call to boot into Win from there. If not, search for where Win is (usually on drive C, in multi - system it can be on D \E); then according to the location of Win, create a suitable msdos.sys, and then call to boot...
This is also suitable for repairing the boot of Win on the hard disk. Everyone give some opinions....
Floor7 Wengier Posted 2003-07-11 00:00
系统支持 Posts 10,521 Credits 27,736
The following is the speech of yiyesong on 2003-7-11 13:44:32:
Hehe, it seems a bit late to bring it up today. WENEIER wrote it too complicated.


The special version of YYS's boot disk, that one, simply can't succeed on my computer. It's garbled and then freezes, so I have to press Ctrl+Alt+Del to restart. And the limitation of YYS's program is too big (totally relying on LOCATE is not good at all), only supports the Chinese version of Win98SE (actually, there is also the Chinese version of Win98SE in my system, but it always freezes when searching). So I just made one by myself just now.
Floor8 yiyesong Posted 2003-07-11 00:00
元老会员 Posts 632 Credits 1,987
WENGIER, you're right. My batch script is only designed for WIN98SE, including the OEM version and the retail version. Because now there are very few people using WIN3X and the first edition of WIN98. I use DOS, but I never use WIN3X and the first edition of WIN98. If you want to support the latter two, you just need to relax the LOCATE condition.

If you boot with my boot disk and encounter garbled characters and a system crash, there's only one possibility: you removed the boot disk when booting WIN98.

Floor9 Wengier Posted 2003-07-11 00:00
系统支持 Posts 10,521 Credits 27,736
The following is the statement by yiyesong on 2003-7-11 21:29:18:
WENGIER, you are right. My batch file is only designed for WIN98SE, including OEM version and retail version. Because there are very few people using WIN3X and the first version of WIN98 now. I use DOS, but I never use WIN3X and the first version of WIN98. If you want to support the latter two, you just need to relax the LOCATE condition.
If you boot with my boot disk, the only possibility of garbled code and system crash is that you took out the boot disk when booting WIN98.


No! I didn't take out the boot disk! It was always in the floppy drive.

Relaxing the LOCATE condition is not that easy, because the size and time of WIN.COM can be changed arbitrarily. For example, if I change the embedded LOGO in WIN.COM (just like what we did with MiniWin3.x), its size and time will be completely changed; moreover, the sizes and periods of WIN.COM in various international language versions are not the same, and these are definitely not what LOCATE can handle. And, that function does not support manual selection when there are multiple WINs in the hard disk. But the batch file I mentioned above can do it all.


Floor10 Wengier Posted 2003-07-13 00:00
系统支持 Posts 10,521 Credits 27,736
The following is a quote from Dian Ji Ru Qin on 2003-7-11 14:06:30:
Let me give my opinion:
I haven't understood the above batch processing yet....
Mine is CD-ROM boot, and the virtual disk will disappear after booting into win, so the boot disk can't boot into win; now seeing your posts, I think whether it can be like this: the user must know whether there is win on the machine, first check if there is msdos.sys in the root directory of drive C. If there is, call to boot into win from there. If not, search for where win is (usually on drive C, in multi-system it can be on drive D \ E); then according to the location of win, create a suitable msdos.sys, and then call to boot...

This is also suitable for repairing the win boot on the hard disk. Everyone give some opinions....


Which parts haven't you understood yet?
Everyone can add more functions to the batch processing file I made above to further improve it.
Floor11 Roy Posted 2003-07-13 00:00
管理员 Posts 1,633 Credits 4,869
There is also one item that cannot be ignored, which is excluding the function of booting Windows NT/2000/XP. As everyone knows, Windows NT/2000/XP all have win.com, but this win.com cannot be executed by MS-DOS, but is executed by NTLDR.
Floor12 Wengier Posted 2003-07-13 00:00
系统支持 Posts 10,521 Credits 27,736
The following is a quote from Roy on 2003-7-13 8:49:01:
There is another item that cannot be ignored, which is to exclude the function of booting Windows NT/2000/XP.
As everyone knows, Windows NT/2000/XP all have win.com, but this win.com cannot be executed by MS-DOS, but by NTLDR.


Yes. The batch file I mentioned above can automatically exclude the "fake" WIN.COM of WinNT/2K/XP and only search for Win3.x/9x/ME. (Note: I have Win3.x, Win9x, WinME, and Win2K on my hard drive, and the effect of using it for automatic search is very ideal..)

Floor13 电吉入侵 Posted 2003-07-13 00:00
初级用户 Posts 377 Credits 1,480
I can't start Windows 98 on the multi-boot CD no matter what, but I can start it with a floppy disk and a single-boot CD; however, after starting with the single-boot CD, there's a virtual floppy disk in the floppy drive, and the real floppy drive can't be used....

Does anyone have a way to start Windows 9X on a multi-boot CD?
Floor14 电吉入侵 Posted 2003-07-13 00:00
初级用户 Posts 377 Credits 1,480
Wengier, didn't you say that as long as there is

WinBootDir=.

it would be okay? But it doesn't work for me. I must have

WinDir=a:\
WinBootDir=.
HostWinBootDrv=a

to work. Why?

Floor15 Wengier Posted 2003-07-14 00:00
系统支持 Posts 10,521 Credits 27,736
The following is a quote from Dian Ji Ru Qin on 2003-7-13 19:52:55:
Wengier, didn't you say that as long as there is

WinBootDir=.

it would be okay? But it doesn't work for me. I must have

WinDir=a:\
WinBootDir=.
HostWinBootDrv=a

to work. Why?


That's because when there is no windir item, the system will not automatically load the IFSHLP.SYS file during startup. At this time, you can manually load it on the command line, for example, using the DEVICE/DEVLOAD/ADDEV command. Then run WIN and everything will be okay. Or adding windir is also okay. And HostWinBootDrv is usually completely unnecessary unless there are disk compression programs like DBLSPACE/DRVSPACE.


1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023