Bat ·

Windows Server 原版系统安装完后优化改造

下面这个cmd命令是运维天涯博主经常帮别人安装系统,所以为了方便快捷,专门写了一个bat 分享给大家。

@echo off
color 5e
mode con cols=76 lines=30
set Source_Dir=J:\sources\sxs

echo.
echo 部署在 windows 上操作
set TempFile_Name=%SystemRoot%\System32\BatTestUACin_SysRt%Random%.batemp
( echo "BAT Test UAC in Temp" >%TempFile_Name% ) 1>nul 2>nul
if exist %TempFile_Name% (
del %TempFile_Name% 1>nul 2>nul
GOTO setting
) else (
GOTO admin
)
:setting
echo.
echo 部署在windows 上操作 Net 桌面
echo 依赖必须启用
dism /online /Enable-Feature /All /FeatureName:MicrosoftWindowsPowerShellISE /Source:%Source_Dir%
echo.
echo.
echo 安装.net 3.5 
dism /online /Enable-Feature /All /FeatureName:NetFX3 /Source:%Source_Dir%
dism /online /Enable-Feature /All /FeatureName:NetFx3ServerFeatures /Source:%Source_Dir%

echo NET Framework 4.5 功能
Dism /online /Enable-Feature /All /FeatureName:NetFx4ServerFeatures /Source:%Source_SXS%
echo.
echo.
echo 开启桌面体验
dism /online /Enable-Feature /All /FeatureName:DesktopExperience /Source:%Source_Dir%
echo.
echo.
echo 优质Windows音频视频体验
dism /online /Enable-Feature /All /FeatureName:QWAVE /Source:%Source_Dir%
echo.
echo.
echo 无线
dism /online /Enable-Feature /All /FeatureName:WirelessNetworking /Source:%Source_Dir%
echo.
echo.
echo telnet 命令
dism /online /Enable-Feature /All /FeatureName:TelnetClient /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:MSMQ /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:MSMQ-Services /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:MSMQ-Server /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:File-Services /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:CoreFileServer /Source:%Source_Dir%
echo.
echo.
echo 添加媒体中心
dism /online /Enable-Feature /All /FeatureName:ServerMediaFoundation /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:InkAndHandwritingServices /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:MediaPlayback /Source:%Source_Dir%
echo.
echo.
dism /online /Enable-Feature /All /FeatureName:WindowsMediaPlayer /Source:%Source_Dir%
echo.
echo.

sc stop wsearch
sc config WMPNetworkSvc start= disabled
sc config wsearch start= disabled
echo 完成

 

评论已关闭