微軟近期推出了改善Windows 10 3月份安裝更新後出現的列印當機、藍底白字(藍屏)問題,針對各個Windows版本有相對應的更新檔需要安裝,如果公司是有Win AD可以派送當然不是什麼大問題,但如果沒有AD可以派送群組原則,且公司的WIndows 10又有許多不同的版本那該怎樣辦才好呢?
請MIS(資訊)同仁一台台case by case檢查安裝嗎?
別鬧了~整死MIS而已,小編這邊提供個批次檔寫法,讓大家可以快速安裝windows 10修正檔。
建立個文字檔,且另存檔名為「win10-fixprint.bat」,注意附檔名得改為bat不能是txt。
win10-fixprint.bat檔案內容如下:
@echo off
echo 修正windows 10 2021-03錯誤更新,導致列印當機問題…..
Wmic OS Get Caption | Find /i “Windows 10” >nul && Goto Win10
msg * /server:127.0.0.1 “該系統不是windows 10無需修正”
exit
:Win10
c:
mkdir c:\temp
cd c:\temp
Reg Query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ReleaseId | Find /i “2009” >nul && Goto Win1020H2
Reg Query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ReleaseId | Find /i “2004” >nul && Goto Win102004
Reg Query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ReleaseId | Find /i “1909” >nul && Goto Win101909
Reg Query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ReleaseId | Find /i “1809” >nul && Goto Win101809
Reg Query “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion” /v ReleaseId | Find /i “1803” >nul && Goto Win101803
msg * /server:127.0.0.1 “該windows 10版本無需修正”
exit
:Win1020H2
echo ===============下載Windows 10 KB5001567修正檔===============
@for /f “tokens=1-1 delims=-” %%a in (‘wmic os get osarchitecture ^| findstr bit’) do (set osbitcheck=%%a)
IF “%osbitcheck%” == “32” (
bitsadmin.exe /transfer “KB5001567” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001567-x86_bafeb1bea06a5f39976de3406d3e33fb3cc2c6fe.msu C:\Temp\2009-x86.msu > nul
cls
echo ===============安裝Windows 10 KB5001567修正檔===============
start /wait 2009-x86.msu
) ELSE (
bitsadmin.exe /transfer “KB5001567” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001567-x64_e3c7e1cb6fa3857b5b0c8cf487e7e16213b1ea83.msu C:\Temp\2009-x64.msu > nul
cls
echo ===============安裝Windows 10 KB5001567修正檔===============
start /wait 2009-x64.msu
)
exit
:Win102004
echo ===============下載Windows 10 KB5001567修正檔===============
@for /f “tokens=1-1 delims=-” %%a in (‘wmic os get osarchitecture ^| findstr bit’) do (set osbitcheck=%%a)
IF “%osbitcheck%” == “32” (
bitsadmin.exe /transfer “KB5001567” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001567-x86_bafeb1bea06a5f39976de3406d3e33fb3cc2c6fe.msu C:\Temp\2004-x86.msu > nul
cls
echo ===============安裝Windows 10 KB5001567修正檔===============
start /wait 2004-x86.msu
) ELSE (
bitsadmin.exe /transfer “KB5001567” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001567-x64_e3c7e1cb6fa3857b5b0c8cf487e7e16213b1ea83.msu C:\Temp\2004-x64.msu > nul
cls
echo ===============安裝Windows 10 KB5001567修正檔===============
start /wait 2004-x64.msu
)
exit
:Win101909
echo ===============下載Windows 10 KB5001566修正檔===============
@for /f “tokens=1-1 delims=-” %%a in (‘wmic os get osarchitecture ^| findstr bit’) do (set osbitcheck=%%a)
IF “%osbitcheck%” == “32” (
bitsadmin.exe /transfer “KB5001566” http://download.windowsupdate.com/c/msdownload/update/software/updt/2021/03/windows10.0-kb5001566-x86_d0134617d527f736cb73e2073b4269642c68d4a4.msu C:\Temp\1909-x86.msu > nul
cls
echo ===============安裝Windows 10 KB5001566修正檔===============
start /wait 1909-x86.msu
) ELSE (
bitsadmin.exe /transfer “KB5001566” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001566-x64_b52b66b45562d5a620a6f1a5e903600693be1de0.msu C:\Temp\1909-x64.msu > nul
cls
echo ===============安裝Windows 10 KB5001566修正檔===============
start /wait 1909-x64.msu
)
exit
:Win101809
echo ===============下載Windows 10 KB5001568修正檔===============
@for /f “tokens=1-1 delims=-” %%a in (‘wmic os get osarchitecture ^| findstr bit’) do (set osbitcheck=%%a)
IF “%osbitcheck%” == “32” (
bitsadmin.exe /transfer “KB5001568” http://download.windowsupdate.com/c/msdownload/update/software/updt/2021/03/windows10.0-kb5001568-x86_ac43cdb614bfc2b4692ab2503efddc041a5b0c02.msu C:\Temp\1809-x86.msu > nul
cls
echo ===============安裝Windows 10 KB5001568修正檔===============
start /wait 1809-x86.msu
) ELSE (
bitsadmin.exe /transfer “KB5001568” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001568-x64_cbfb9504eda6bf177ad678c64b871a3e294514ce.msu C:\Temp\1809-x64.msu > nul
cls
echo ===============安裝Windows 10 KB5001568修正檔===============
start /wait 1809-x64.msu
)
exit
:Win101803
echo ===============下載Windows 10 KB5001565修正檔===============
@for /f “tokens=1-1 delims=-” %%a in (‘wmic os get osarchitecture ^| findstr bit’) do (set osbitcheck=%%a)
IF “%osbitcheck%” == “32” (
bitsadmin.exe /transfer “KB5001565” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001565-x86_f87e104677d8b32eda140b953205ac8bb8dda1eb.msu C:\Temp\1803-x86.msu > nul
cls
echo ===============安裝Windows 10 KB5001565修正檔===============
start /wait 1803-x86.msu
) ELSE (
bitsadmin.exe /transfer “KB5001565” http://download.windowsupdate.com/d/msdownload/update/software/updt/2021/03/windows10.0-kb5001565-x64_18a2f1393a135d9c3338f35dedeaeba5a2b88b19.msu C:\Temp\1803-x64.msu > nul
cls
echo ===============安裝Windows 10 KB5001565修正檔===============
start /wait 1803-x64.msu
)
exit