China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-02 06:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to write a batch script to automatically install the 98 patch package? View 1,654 Replies 4
Original Poster Posted 2006-08-12 21:19 ·  中国 浙江 台州 电信
管理员
★★★★
DOS非常爱好者
Credits 6,215
Posts 2,601
Joined 2006-01-20 13:00
20-year member
UID 49256
Status Offline
I downloaded all the patches for the Chinese version of Windows 98 SE, but it's too laborious to install them one by one. I remember that XP patches can be automatically completed at one time through batch processing. Can 98SE do that?
Floor 2 Posted 2006-08-15 15:15 ·  中国 四川 成都 鹏博士宽带
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
I don't know what the patch file name for 98 looks like. I searched online and found a section of code that is relatively useful. After modification, the following code is obtained. I don't know if it can run successfully under 98:

@echo off
goto begin

Put this script directly in the patch directory and run it
Note: The folders 1, 2, 3, 4 in the patch directory will be newly created. Please ensure that there are no important materials in these four folders
The main code of this script is from the Internet. jm made some modifications on 2006-8-15
Claimed for 98/ME/2000/XP/2003
Only tested on XP and 2003 systems

:begin
title System Patch Automatic Installation Program
color 1f
md 1 2 3 4 >nul 2>nul
for %%i in (*.exe) do (
(echo %%i|findstr "updfile">nul 2>nul && move %%i 1) || (
echo %%i|findstr "_sfx_cab_exe_package">nul 2>nul && move %%i 2) || (
echo %%i|findstr "update.exe">nul 2>nul && move %%i 3) || (
echo %%i|findstr "_sfx_cab_exe_path">nul 2>nul && move %%i 4)
)
If not exist *.exe (goto auto_install) else (goto list)
:list
echo.
echo ========================================================
echo.
for %%i in (*.exe) do echo %%i needs to be installed manually
echo.
echo ========================================================
echo.
echo When the patches that can be installed automatically are installed, please install the above patches manually
:auto_install
echo.
echo ========================================================
echo.
echo All patches that can be installed automatically have been placed in directories 1, 2, 3, 4 respectively.
echo.
echo Press any key to continue...
pause>nul
cd /d 1
for %%i in (*.exe) do start /wait %%i /q
cd /d 2
for %%i in (*.exe) do start /wait %%i /passive /norestart /o /n
cd /d 3
for %%i in (*.exe) do start /wait %%i -n -o -z
cd /d 4
for %%i in (*.exe) do start /wait %%i /passive /norestart /o /n


[ Last edited by namejm on 2006-11-17 at 04:36 PM ]
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 3 Posted 2006-08-15 16:40 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Supplementary notes:

Windows installation packages almost all have unattended installation commands, including .msi.

*.exe /quiet /norestart /n

*.exe /quiet /passive /norestart /nobackup

/quiet Quiet mode

/passive Passive mode

/norestart Do not restart after installation

/nobackup Do not back up files needed for uninstallation

The relatively common parameters for Xplode plug-in installation are /q /o /n /z
Floor 4 Posted 2006-10-03 09:39 ·  中国 山东 东营 联通
新手上路
Credits 8
Posts 4
Joined 2006-10-03 05:37
19-year member
UID 64382
Status Offline
Just what is needed, and study hard.
Floor 5 Posted 2006-10-07 04:18 ·  中国 山东 东营 联通
新手上路
Credits 8
Posts 4
Joined 2006-10-03 05:37
19-year member
UID 64382
Status Offline
I found a more concise code:
@echo off
goto begain

:begain
color 1f
FOR /R %%F IN (.\*.exe) DO @((@findstr _SFX_CAB_EXE_PATH "%%F" >nul && @start /wait %%F /Quiet /Norestart /Nobackup)|| @start /wait %%F )
Forum Jump: