I'd like the experts to take a look.
===========================
After our bureau's office LAN was built, it was troubled for a long time by system vulnerabilities and virus attacks, causing the network to crash frequently. To solve this problem, by using sharing we implemented a solution on the machine in the communications room (access method: \\10.157.xx.xx) to automatically install system patches and the latest virus definitions in the LAN. Below is an explanation of the script file.
@echo off
cls
echo.
echo ********************************
echo * *
echo * Function: a script for installing M$ patches on an internal *
echo * network that cannot access the Internet *
echo * Limitation: this version can only be used with WINDOWS XP SP2 *
echo * Simplified Chinese edition; other versions are *
echo * currently being made. *
echo * Author: Yu Zhenzhong *
echo * e-mail:yuzhenzhong@163.net *
echo * Patch date: March 18, 2005 *
echo * *
echo ********************************
echo.
rem Set server IP and shared path
set HotPatch=\\c02\hotfix\xp\sp2
rem Create temporary folder
set mhnet=%temp%\mhnet
rem @rmdir /S /Q %mhnet% 2>NUL 1>NUL
mkdir %mhnet%
rem Main program starts
:Start
rem Check completeness of required files
rem call :AllFiles
rem Check whether it is a WINDOWS XP SP2 system
call :CheckSystem
rem Check whether administrator privileges are present
call :CheckAdmin
echo.
pause
rem Start upgrading the system
call :HotfixUp
rem Delete temporary directory, clear variables
rmdir /S /Q %mhnet% 2>NUL 1>NUL
set mhnet=
set HotPatch=
goto :eof
exit
:ends
rem Main program ends
rem *************************
rem *************************
rem Determine whether the system version is WINDOWS XP SP2, otherwise exit
rem *************************
rem *************************
:CheckSystem
rem First determine whether the system version belongs to the WINDOWS NT series; if it is the WIN98 series then exit
IF %OS%==Windows_NT (
rem Determine again whether the system version is SP2
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CSDVersion" >%mhnet%\banben.log
find "Service Pack 2" %mhnet%\banben.log >NUL
IF ERRORLEVEL 1 (
cls
echo.
echo Note: this program can only be used on systems running Windows XP SP2.
echo Please upgrade to Windows XP SP2 first, then run this program!!!
pause
exit
) else (
echo User is running a Windows XP SP2 system,
)
) else (
rem System is the win98 series.
cls
echo.
echo Runtime error!
echo.
echo Note: this program cannot be used on systems of the %os% series.
pause
exit
)
goto :eof
rem *************************
rem *************************
rem Determine whether administrator privileges are present, otherwise exit
rem *************************
rem *************************
:CheckAdmin
net user %username% > %mhnet%\ifadmin.log
rem If not a system administrator
find "*Administrators " %mhnet%\ifadmin.log >NUL
IF ERRORLEVEL 1 (
cls
echo Runtime error!
echo.
echo Note: the user is not a member of the system administrators group and cannot execute this program!!!
echo Please switch to a user with sufficient privileges and run this program again.
pause
exit
goto :eof
) else (
echo The user belongs to the system administrators group and can execute this program.
)
goto :eof
rem *************************
rem *************************
rem Map the shared patch package directory on the server to local drive S, and run the patch packages one by one
rem *************************
rem *************************
:HotfixUp
net use S: %HotPatch%
S:
cls
echo Note! Do not close this program. It will exit automatically after the system upgrade is finished.
echo The system is being upgraded, please wait......
IF not EXIST %SystemRoot%\KB834707.log KB834707.exe /passive /norestart
IF not EXIST %SystemRoot%\KB867282.log KB867282.exe /passive /norestart
IF not EXIST %SystemRoot%\KB873333.log KB873333.exe /passive /norestart
IF not EXIST %SystemRoot%\KB873339.log KB873339.exe /passive /norestart
IF not EXIST %SystemRoot%\KB885250.log KB885250.exe /passive /norestart
IF not EXIST %SystemRoot%\KB885835.log KB885835.exe /passive /norestart
IF not EXIST %SystemRoot%\KB886185.log KB886185.exe /passive /norestart
IF not EXIST %SystemRoot%\KB887742.log KB887742.exe /passive /norestart
IF not EXIST %SystemRoot%\KB888113.log KB888113.exe /passive /norestart
IF not EXIST %SystemRoot%\KB890047.log KB890047.exe /passive /norestart
IF not EXIST %SystemRoot%\KB890175.log KB890175.exe /passive /norestart
IF not EXIST %SystemRoot%\KB891781.log KB891781.exe /passive /norestart
IF not EXIST %SystemRoot%\KB887472.log KB887472.exe /q
rem Fix the pending file version problem that may be caused by running multiple patch packages at once without rebooting the system
Qchain.exe
rem Delete the local shared mapped drive
C:
net use S: /Delete /Y
goto :eof
rem ----- this is the end of this batch file -------
===========================
After our bureau's office LAN was built, it was troubled for a long time by system vulnerabilities and virus attacks, causing the network to crash frequently. To solve this problem, by using sharing we implemented a solution on the machine in the communications room (access method: \\10.157.xx.xx) to automatically install system patches and the latest virus definitions in the LAN. Below is an explanation of the script file.
@echo off
cls
echo.
echo ********************************
echo * *
echo * Function: a script for installing M$ patches on an internal *
echo * network that cannot access the Internet *
echo * Limitation: this version can only be used with WINDOWS XP SP2 *
echo * Simplified Chinese edition; other versions are *
echo * currently being made. *
echo * Author: Yu Zhenzhong *
echo * e-mail:yuzhenzhong@163.net *
echo * Patch date: March 18, 2005 *
echo * *
echo ********************************
echo.
rem Set server IP and shared path
set HotPatch=\\c02\hotfix\xp\sp2
rem Create temporary folder
set mhnet=%temp%\mhnet
rem @rmdir /S /Q %mhnet% 2>NUL 1>NUL
mkdir %mhnet%
rem Main program starts
:Start
rem Check completeness of required files
rem call :AllFiles
rem Check whether it is a WINDOWS XP SP2 system
call :CheckSystem
rem Check whether administrator privileges are present
call :CheckAdmin
echo.
pause
rem Start upgrading the system
call :HotfixUp
rem Delete temporary directory, clear variables
rmdir /S /Q %mhnet% 2>NUL 1>NUL
set mhnet=
set HotPatch=
goto :eof
exit
:ends
rem Main program ends
rem *************************
rem *************************
rem Determine whether the system version is WINDOWS XP SP2, otherwise exit
rem *************************
rem *************************
:CheckSystem
rem First determine whether the system version belongs to the WINDOWS NT series; if it is the WIN98 series then exit
IF %OS%==Windows_NT (
rem Determine again whether the system version is SP2
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CSDVersion" >%mhnet%\banben.log
find "Service Pack 2" %mhnet%\banben.log >NUL
IF ERRORLEVEL 1 (
cls
echo.
echo Note: this program can only be used on systems running Windows XP SP2.
echo Please upgrade to Windows XP SP2 first, then run this program!!!
pause
exit
) else (
echo User is running a Windows XP SP2 system,
)
) else (
rem System is the win98 series.
cls
echo.
echo Runtime error!
echo.
echo Note: this program cannot be used on systems of the %os% series.
pause
exit
)
goto :eof
rem *************************
rem *************************
rem Determine whether administrator privileges are present, otherwise exit
rem *************************
rem *************************
:CheckAdmin
net user %username% > %mhnet%\ifadmin.log
rem If not a system administrator
find "*Administrators " %mhnet%\ifadmin.log >NUL
IF ERRORLEVEL 1 (
cls
echo Runtime error!
echo.
echo Note: the user is not a member of the system administrators group and cannot execute this program!!!
echo Please switch to a user with sufficient privileges and run this program again.
pause
exit
goto :eof
) else (
echo The user belongs to the system administrators group and can execute this program.
)
goto :eof
rem *************************
rem *************************
rem Map the shared patch package directory on the server to local drive S, and run the patch packages one by one
rem *************************
rem *************************
:HotfixUp
net use S: %HotPatch%
S:
cls
echo Note! Do not close this program. It will exit automatically after the system upgrade is finished.
echo The system is being upgraded, please wait......
IF not EXIST %SystemRoot%\KB834707.log KB834707.exe /passive /norestart
IF not EXIST %SystemRoot%\KB867282.log KB867282.exe /passive /norestart
IF not EXIST %SystemRoot%\KB873333.log KB873333.exe /passive /norestart
IF not EXIST %SystemRoot%\KB873339.log KB873339.exe /passive /norestart
IF not EXIST %SystemRoot%\KB885250.log KB885250.exe /passive /norestart
IF not EXIST %SystemRoot%\KB885835.log KB885835.exe /passive /norestart
IF not EXIST %SystemRoot%\KB886185.log KB886185.exe /passive /norestart
IF not EXIST %SystemRoot%\KB887742.log KB887742.exe /passive /norestart
IF not EXIST %SystemRoot%\KB888113.log KB888113.exe /passive /norestart
IF not EXIST %SystemRoot%\KB890047.log KB890047.exe /passive /norestart
IF not EXIST %SystemRoot%\KB890175.log KB890175.exe /passive /norestart
IF not EXIST %SystemRoot%\KB891781.log KB891781.exe /passive /norestart
IF not EXIST %SystemRoot%\KB887472.log KB887472.exe /q
rem Fix the pending file version problem that may be caused by running multiple patch packages at once without rebooting the system
Qchain.exe
rem Delete the local shared mapped drive
C:
net use S: /Delete /Y
goto :eof
rem ----- this is the end of this batch file -------
Freebsd网站架设\局域网维护管理\硬件维修\电路图纸
欢迎到 振兴电子
http://zxdz.8800.org
欢迎到 振兴电子
http://zxdz.8800.org

