Installing Windows Deployment Services (WDS) From a Batch File

I needed to install WDS on 300+ servers but found that the server build did not have a local copy of OS setup or service pack files. I also wanted to set the paths back to the original values.

I started by adding all files required by WDS to the DFS and I created the following batch file.

********** START **********
@ECHO OFF

REG EXPORT "HKLMSOFTWAREMicrosoftWindowsCurrentVersionSetup"% WINDIR% InstallWDS.reg / y
REG ADD "HKLMSOFTWAREMicrosoftWindowsCurrentVersionSetup" / v "SourcePath" / t REG_SZ / d "SERVERNAMESHARE" / f
REG ADD "HKLMSOFTWAREMicrosoftWindowsCurrentVersionSetup" / v "ServicePackSourcePath" / t REG_SZ / d "SERVERNAMESHARE" / f

VER | Find "Microsoft 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

: Win2008
ServerManagerCmd -install WDS
GoTo CleanUp

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

The basic steps are:
1) Backup registry key to "InstallWDS.reg"
2) Set cache paths for OS and service pack files (SERVERNAMESHARE which is UNC path to files)
3) Execute the command for installation of component on the detected OS – Note that for Windows 2003 a file called "InstallWDS.inf" is created
4) Restore registry key backup from step 1
5) Delete "InstallWDS.inf" required by Windows 2003
6) Delete registry key backup file "InstallWDS.reg"

This batch can easily be modified to install virtually any Windows component



Source by Shaun Vermaak

Mourad ELGORMA

Fondateur de summarynetworks, passionné des nouvelles technologies et des métiers de Réseautique , Master en réseaux et système de télécommunications. ,j’ai affaire à Pascal, Delphi, Java, MATLAB, php …Connaissance du protocole TCP / IP, des applications Ethernet, des WLAN …Planification, installation et dépannage de problèmes de réseau informatique……Installez, configurez et dépannez les périphériques Cisco IOS. Surveillez les performances du réseau et isolez les défaillances du réseau. VLANs, protocoles de routage (RIPv2, EIGRP, OSPF.)…..Manipuler des systèmes embarqués (matériel et logiciel ex: Beaglebone Black)…Linux (Ubuntu, kali, serveur Mandriva Fedora, …). Microsoft (Windows, Windows Server 2003). ……Paquet tracer, GNS3, VMware Workstation, Virtual Box, Filezilla (client / serveur), EasyPhp, serveur Wamp,Le système de gestion WORDPRESS………Installation des caméras de surveillance ( technologie hikvision DVR………..). ,

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *