March 18, 2025

Network System

Une technologie unique

Setting up Windows Deployment Services (WDS) From a Batch File

I necessary to install WDS on 300+ servers but identified that the server construct did not have a community copy of OS setup or support pack files. I also preferred to set the paths again to the first values.

I started off by including all files demanded by WDS to the DFS and I developed the subsequent batch file.

**********Start off**********
@ECHO OFF

REG EXPORT “HKLMSOFTWAREMicrosoftWindowsCurrentVersionSetup” %WINDIR%InstallWDS.reg /y
REG Include “HKLMSOFTWAREMicrosoftWindowsCurrentVersionSetup” /v “SourcePath” /t REG_SZ /d “SERVERNAMESHARE” /f
REG Insert “HKLMSOFTWAREMicrosoftWindowsCurrentVersionSetup” /v “ServicePackSourcePath” /t REG_SZ /d “SERVERNAMESHARE” /f

VER | Obtain “Microsoft Home windows [Version 5.2.” > nul
If %ERRORLEVEL% == 0 GoTo Win2003
VER | Find “Microsoft Windows [Version 6.0.” > nul
If %ERRORLEVEL% == 0 GoTo Win2008

GoTo CleanUp

:Win2003
ECHO [Components] > %WINDIR%InstallWDS.inf
ECHO RemInst = on >> %WINDIR%InstallWDS.inf
Sysocmgr.exe /i:sysoc.inf /u:%WINDIR%InstallWDS.inf
GoTo CleanUp

:Earn2008
ServerManagerCmd -install WDS
GoTo CleanUp

:CleanUp
REG IMPORT %WINDIR%InstallWDS.reg
DEL %WINDIR%InstallWDS.inf
DEL %WINDIR%InstallWDS.reg
**********End**********

The fundamental steps are:
1) Backup registry critical to “InstallWDS.reg”
2) Set cache paths for OS and services pack data files (SERVERNAMESHARE which is UNC path to data files)
3) Execute the command for set up of element on the detected OS – Note that for Windows 2003 a file known as “InstallWDS.inf” is developed
4) Restore registry crucial backup from move 1
5) Delete “InstallWDS.inf” required by Windows 2003
6) Delete registry vital backup file “InstallWDS.reg”

This batch can easily be modified to set up just about any Windows part

Leave a Reply