Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: SOURCE: https://winaero.com/blog/offline-install-of-net-framework-3-5-in-windows-10-using-dism/
- ::
- :: USAGE: Plug your Windows 10 USB stick in (or mount the Windows 10 .iso file) and run this script with admin privileges.
- :: It will search for the install media and install .Net 3.5 from it.
- ::
- :: NOTE: The reason for this script is because "dotnetfx35.exe", the official offline installer for .Net 3.5, still requires internet access.
- :CheckPermissions
- setlocal
- fltmc >nul 2>&1 && (
- goto :Work
- ) || (
- echo Error: This script requires administrator privileges.
- echo.
- echo Right click this scripts icon and select "Run as Administrator".
- echo.
- goto :End
- )
- endlocal & goto :eof
- :Work
- Title .NET Framework 3.5 Offline Installer
- for %%I in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%I:\\sources\install.wim" set setupdrv=%%I
- if defined setupdrv (
- echo Found installation media on drive %setupdrv%
- echo.
- echo Installing .Net Framework 3.5...
- Dism /online /enable-feature /featurename:NetFX3 /All /Source:%setupdrv%:\sources\sxs /LimitAccess
- echo.
- echo .Net Framework 3.5 installation complete...
- echo.
- ) else (
- echo No installation media found!
- echo Insert DVD or USB flash drive and run this file once again.
- echo.
- )
- :End
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement