Skip to content

Instantly share code, notes, and snippets.

@thephilip
Last active November 9, 2017 17:18
Show Gist options
  • Save thephilip/e90ee04a5c108230a0f8b4cd6f678945 to your computer and use it in GitHub Desktop.
Save thephilip/e90ee04a5c108230a0f8b4cd6f678945 to your computer and use it in GitHub Desktop.
.NET3.5 Re-enabler
:: -------------------------------------
:: Inject .Net3.5 Remotely |
:: -------------------------------------
:: By: Philip Smith
:: Requires 'psexec' in PATH.
:: Download: https://live.sysinternals.com/
:: User executing script needs access to src
:: and in the administrators group on dest.
@echo off
set host=%1
:: src is where you store the .cab files to copy
:: to the host. the files are stored either on the
:: install disc or ISO under \sources\sxs
set src=
set dest=\\%host%\c$\_rdotnet\sxs
if [%1]==[] goto :USAGE
echo Install Host: %host%
echo Install Source: %src%
echo.
echo Copying source files to %dest%...
mkdir %dest%
xcopy %src%\*.cab %dest%
psexec \\%host% dism /online /enable-feature /featurename:NetFx3 /all /limitaccess /source:%dest%
goto :END
:USAGE
echo USAGE: rNET35-inst hostname
echo.
:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment