Debian Codegraph @

pkg/syslinux/makeboot.bat

raw
1 @echo off
2 setlocal EnableDelayedExpansion
3 title %~nx0
4 rem 01/13/2016 - Added error routine and other minor changes by Robert Rubino
5 rem This batch file was modified by Steven Shiau.
6 rem The original one is from PDLA http://pendrivelinux.com
7 rem This batch file was created by ©2007 PDLA http://pendrivelinux.com
8 cd /d "%~dp0"
9 cls
10 echo ---------------------------------------------------------------
11 echo This batch file will prepare drive %~d0 for boot using syslinux
12 echo --------------------- WARNING ---------------------------------
13 echo Run this file from your portable USB device ONLY.
14 echo.
15 echo Running this file from your hard drive may overwrite your current
16 echo Master Boot Record (MBR) and render your Windows Operating System
17 echo un-bootable. YOU HAVE BEEN WARNED.
18 echo.
19 echo This batch file is offered in hopes that it will be useful and
20 echo comes with absolutely no warranty. && echo. && echo *** USE AT YOUR OWN RISK ***
21 echo -----------------------------------------------------------------
22 pause
23 cls
24 if %~d0 == %systemdrive% (color 4f && echo Do not run %~nx0 from your local system hard drive. && echo It should only be run from your USB flash drive or USB hard drive. && goto end)
25 rem echo %~d0 | "%windir%\system32\findstr.exe" /B /I "%systemdrive%" && color 4f && echo You can _NOT_ RUN %~nx0 from your local system hard drive! It should only be run from your USB flash drive or USB hard drive. && goto end
26 echo.
27 echo Press any key to make drive %~d0 bootable
28 echo or close this window to abort...
29 pause > nul
30 cls
31 syslinux.exe -d syslinux -mafi %~d0
32 if !errorlevel! neq 0 (
33 color 4f
34 echo.
35 echo ----------------------------
36 echo *** FATAL ERROR ***
37 echo *** %~d0 drive is not bootable for Clonezilla ***
38 echo *** %~nx0 should be run as Administrator ***
39 echo *** or other major failure has occurred ***
40 echo ----------------------------
41 goto end
42 )
43 echo.
44 echo ~~~~~~~~ Congratulations ~~~~~~~
45 echo The hidden file ldlinux.sys has been installed
46 echo Your %~d0 drive should now be bootable.
47 echo //NOTE// If your USB flash drive fails to boot (maybe buggy BIOS), try to use "syslinux -d syslinux -sfmar %~d0".
48 echo.
49 :end
50 echo.
51 cd /d %systemdrive%
52 echo *** Press any key to exit this window ***
53 pause > nul