-
Notifications
You must be signed in to change notification settings - Fork 3
/
wdspxechain.bat
executable file
·65 lines (55 loc) · 2.46 KB
/
wdspxechain.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
:: PXE Chains a WDS server to secondary GNU/Linux server
:: Michael McMahon
:: Open a command prompt with Administrator privaleges.
:: cd ..\..\Users\Administrator\Downloads
:: powershell -Command "Invoke-WebRequest ftp://10.12.17.15/pub/scripts/wdspxechain.bat -Outfile wdspxechain.bat"
:: wdspxechain.bat
:: Do not display commands
@echo off
echo Downloading syslinux 6.03...
powershell -Command "Invoke-WebRequest https://www.kernel.org/pub/linux/utils/boot/syslinux/6.xx/syslinux-6.03.zip -OutFile syslinux-6.03.zip"
echo Extracting syslinux 6.03...
powershell Expand-Archive -Path "syslinux-6.03.zip" -DestinationPath "syslinux-6.03"
echo Backing up original files...
copy D:\RemoteInstall\Boot\x64\pxeboot.com D:\RemoteInstall\Boot\x64\pxeboot.0
copy D:\RemoteInstall\Boot\x64\abortpxe.com D:\RemoteInstall\Boot\x64\abortpxe.0
echo Copying syslinux files...
copy syslinux-6.03/bios/com32/chain/chain.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/com32/lib/libcom32.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/com32/menu/menu.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/com32/menu/vesamenu.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/com32/modules/pxechn.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/com32/libutil/libutil.c32 D:\RemoteInstall\Boot\x64\
copy syslinux-6.03/bios/core/pxelinux.0 D:\RemoteInstall\Boot\x64\
echo Creating pxelinux.cfg folder...
mkdir D:\RemoteInstall\Boot\x64\pxelinux.cfg
echo Writing pxelinux.cfg default file...
(
echo DEFAULT menu.c32
echo MENU TITLE WDS PXE Server
echo PROMPT 0
echo TIMEOUT 100 # 10 seconds
echo MENU IMMEDIATE
echo.
echo LABEL wds
echo MENU DEFAULT
echo MENU LABEL ^^Windows Deployment Services ^(WDS^)
echo KERNEL pxeboot.0
echo.
echo LABEL gnulinuxpxe
echo MENU LABEL ^^GNU/Linux PXE Server
echo KERNEL pxechn.c32
echo APPEND 192.168.1.15::pxelinux.0
echo.
echo LABEL abort
echo MENU LABEL ^^Abort PXE
echo Kernel abortpxe.0
echo.
echo LABEL local
echo MENU LABEL Boot from ^^Local Computer
echo LOCALBOOT 0
) > D:\RemoteInstall\Boot\x64\pxelinux.cfg\default
echo Changing PXE default path...
wdsutil /set-server /bootprogram:boot\x64\pxelinux.0 /architecture:x64
wdsutil /set-server /N12bootprogram:boot\x64\pxelinux.0 /architecture:x64