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-04 12:09
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Install system patches in one go View 2,866 Replies 7
Original Poster Posted 2006-11-18 03:16 ·  中国 吉林 长春 电信
初级用户
Credits 111
Posts 3
Joined 2005-05-23 00:00
21-year member
UID 39005
Gender Male
Status Offline
FOR /R %%F IN (.\*.exe) DO @((@findstr _SFX_CAB_EXE_PATH "%%F" >nul && @start /wait %%F /Quiet /Norestart /Nobackup)|| @start /wait %%F )

A script found online, save it as a bat and put it in the patch directory.
Everyone help explain it, and also
Can this fully apply the patches?
Thank you
Floor 2 Posted 2006-11-18 04:25 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
) Regarding Posting ~: )

  Please, Brother dd, when posting a question, add a "?" question mark after the title. This allows quick recognition of a question when viewing the title ~: )

  If you don't add a question mark, in many cases, it will be thought that Brother dd is posting a teaching experience post about "one-time installation of system patches".
  So netizens who are familiar with commands or familiar with installing patches and their parameters will think it's a teaching post and won't enter, indirectly missing the opportunity for an answer ~: )


) Regarding Disassembling the Principle of the Above Script:

  1) Enumerate all files with the extension .exe through the for command (because the extension of the patch is an.exe file)

  2) findstr to find whether the patch program contains the string "_SFX_CAB_EXE_PATH".
    The patch program is packaged, and you can see the unpacked content of other patch programs using a special unpacking tool ~: )

  3) If the patch contains the string "_SFX_CAB_EXE_PATH", run the installation patch mode with parameters.
    If it does not contain the above string, run the patch program in the normal parameter-free mode.


) The Issue of Whether Patches Can Be Fully Applied

  If all patch programs are downloaded, they can be fully applied (under the condition that no unexpected situations occur).

) How to Know the Parameters of the Patch?

  

  Patch file name.EXE --help
  

  Execute the above command to see the running parameters that the patch can specify ~: )

  The parameters used in the above script:
  

  /Quiet    Quiet mode, no user interaction or display.
  /Norestart  Do not restart after patch installation
  /Nobackup  Do not back up files needed for uninstallation
  


[ Last edited by redtek on 2006-11-17 at 04:27 PM ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 3 Posted 2006-11-18 11:35 ·  中国 广东 深圳 深圳坂田数据中心BGP多线
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline

for %%i in (*.exe) do %%i /passive /nostart /nobackup


This one also works. I often use this to apply patches.

/passive is to only show the progress and is also for automatic installation.
/Nostart and /nobackup are well-known, so I won't elaborate.
Floor 4 Posted 2006-11-19 15:16 ·  中国 广东 电信
初级用户
Credits 52
Posts 24
Joined 2006-11-16 06:50
19-year member
UID 70653
Gender Male
Status Offline
Floor 5 Posted 2006-11-20 06:39 ·  中国 广西 南宁 电信
中级用户
★★
Credits 252
Posts 56
Joined 2003-12-29 00:00
22-year member
UID 14605
Gender Male
Status Offline
Floor 6 Posted 2006-11-21 04:02 ·  中国 广西 梧州 电信
新手上路
Credits 4
Posts 2
Joined 2006-11-16 11:12
19-year member
UID 70682
Gender Male
Status Offline
Learned something new again!!!
Floor 7 Posted 2010-10-18 19:25 ·  中国 上海 奉贤区 电信
初级用户
Credits 37
Posts 36
Joined 2008-12-02 13:29
17-year member
UID 132662
Gender Male
Status Offline
Practical, I've been seeking this thing all the time. Great.
Floor 8 Posted 2010-11-08 12:38 ·  中国 河南 南阳 联通
新手上路
Credits 13
Posts 10
Joined 2010-02-26 23:06
16-year member
UID 161269
Gender Male
Status Offline
Forum Jump: