2014-03-10

Windows 8 .NET Framework 3.5 Offline Installation

Windows 8 .NET Framework 3.5 Offline Installation

將 OS 光碟片放入光碟機,或掛上 ISO 後
將以下 Code 存成 *.cmd 執行即可離線安裝 .NET Framework 3.5
參考: http://support.microsoft.com/kb/2785188/zh-tw

----- 批次檔開始 -----

@echo off&color a
title, [ + OFFLINE INSTALL OF NET 3.5 FRAMEWORK - DOS_PROBIE.2012 + ] 
:: =Windows 8 includes .Net 4.5 by default but not .NET 3.5 =
::NOTE: INSTALLS .NET 3.5 FRAMWORK FEATURE ON DEMAND (FoD) FROM INSTALL DISC.
::NetFx35.cmd

:: SCAN_ACTIVE DRIVES
set "drv="
for %%a in (D E F G H I J K L M N) do if exist "%%a:\sources\setup.exe" set drv=%%a:&goto :Install
:Install
if defined drv (
echo == Installing NET 3.5 From Drive %drv%
dism /online /enable-feature /featurename:NetFX3 /all /NoRestart /Source:%drv%\sources\sxs /LimitAccess
:: LOG
REM dism /online /Get-FeatureInfo /FeatureName:NetFx3 >%systemdrive%\NetFx3.log
echo.&echo.
cls
echo * DONE *
echo.&echo.
echo == Press any [KEY] to Close This Screen. &pause>nul
) else (
:: NO_DRIVE
echo == No Active Drive Found!..Insert DVD or USB then Start Over. &pause>nul 
echo.
)

----- 批次檔結束 -----
其中的關鍵指令:
dism /online /enable-feature /featurename:NetFX3 /all /NoRestart /Source:%drv%\sources\sxs /LimitAccess
可將 %drv%\sources\sxs 更換為安裝檔案所在路徑後直接執行

沒有留言:

張貼留言