{"id":119,"date":"2018-11-30T23:24:08","date_gmt":"2018-11-30T15:24:08","guid":{"rendered":"http:\/\/www.zhangyijun.com\/?p=119"},"modified":"2018-11-30T23:24:08","modified_gmt":"2018-11-30T15:24:08","slug":"windows-vps-windows-%e4%b8%80%e9%94%ae%e9%87%8d%e8%a3%85%e7%b3%bb%e7%bb%9f%e4%b8%ba-linux-netboot%e7%bd%91%e7%bb%9c%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"http:\/\/www.zhangyijun.com\/?p=119","title":{"rendered":"[ Windows VPS ] Windows \u4e00\u952e\u91cd\u88c5\u7cfb\u7edf\u4e3a Linux (netboot,\u7f51\u7edc\u5b89\u88c5)"},"content":{"rendered":"<p>\t\t\t\thttps:\/\/moeclub.org\/2018\/10\/31\/670\/<\/p>\n<p>&nbsp;<\/p>\n<p>\u6709\u4e9b\u5382\u5546\u7684\u673a\u5668\u56e0\u7b56\u7565\u95ee\u9898,\u4e0d\u652f\u6301Windows\u91cd\u88c5\u4e3aLinux. \u4f8b\u5982: \u817e\u8baf\u4e91\u975e\u5927\u9646\u533a\u57df.<br \/>\n\u6709\u4e9b\u5382\u5546Windows\u7cfb\u7edf\u76d8\u4f1a\u6bd4Linux\u7cfb\u7edf\u76d8\u5927,\u60f3\u8981\u5927\u4e00\u70b9\u7cfb\u7edf\u76d8. \u4f8b\u5982: AZURE, AWS\u7b49.<br \/>\n\u6709\u4e9b\u5382\u5546\u4e0d\u652f\u6301VNC,\u8fd9\u5bf9\u4e8e\u8f6c\u6362\u7cfb\u7edf\u5b9e\u5728\u4e0d\u65b9\u4fbf.<br \/>\n\u8fd9\u7bc7\u6587\u7ae0\u53ef\u4ee5\u89e3\u51b3\u4ee5\u4e0a\u95ee\u9898.<br \/>\n<strong>Windows to Linux!<\/strong><\/p>\n<p><strong>\u4f7f\u7528\u524d,\u8bf7\u8010\u5fc3\u770b\u5b8c\u6587\u7ae0.<\/strong><br \/>\n<strong>\u5982\u679c\u9020\u6210\u635f\u5931,<a href=\"https:\/\/moeclub.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u840c\u5496<\/a>\u4e0d\u8d1f\u4efb\u4f55\u8d23\u4efb.<\/strong><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>\u66f4\u65b0\u65e5\u5fd7\n<ul>\n<li>2018.11.12<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>1.\u5185\u7f6e\u4e86\u6211\u535a\u5ba2\u4e2d\u63d0\u4f9b\u7684\u4e24\u4e2aWindows\u955c\u50cf\u7684\u9009\u9879,\u4ec5DHCP\u53ef\u7528(\u8c37\u6b4c\u7f51\u76d8,\u5883\u5916\u673a\u5668\u4f7f\u7528).<br \/>\n2.\u4fee\u590d\u4e86SHA1 \u6821\u9a8c\u5931\u8d25\u7684\u95ee\u9898.<br \/>\n3.\u517c\u5bb9\u4e86\u8f83\u4f4e\u7248\u672c PowerShell.<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>2018.11.02<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u589e\u52a0 SHA1 \u6587\u4ef6\u6821\u9a8c, \u907f\u514d\u4e0b\u8f7d\u4e2d\u610f\u5916\u51fa\u9519.<\/p>\n<ul>\n<li style=\"list-style-type: none;\"><\/li>\n<li><strong>\u4f7f\u7528\u65b9\u6cd5:<\/strong>\n<ul>\n<li>\u4e0b\u8f7d\u00a0<u><a href=\"https:\/\/moeclub.org\/attachment\/WindowsSoftware\/win32loader.bat\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>win32loader.bat<\/strong><\/a><\/u>\u00a0.<\/li>\n<li>\n<pre class=\"lang:default decode:true\">@ECHO OFF&amp;@PUSHD %~DP0 &amp;TITLE Win32Loader\nsetlocal enabledelayedexpansion\n::Author MoeClub.org\ncolor 87\ncd.&gt;%windir%\\GetAdmin\nif exist %windir%\\GetAdmin (del \/f \/q \"%windir%\\GetAdmin\") else (\necho CreateObject^(\"Shell.Application\"^).ShellExecute \"%~s0\", \"%*\", \"\", \"runas\", 1 &gt;&gt; \"%temp%\\Admin.vbs\"\n\"%temp%\\Admin.vbs\"\ndel \/s \/q \"%temp%\\Admin.vbs\"\nexit \/b 2)\ncls\n\necho * Init Win32Loader.\nset download=0\nset try_download=1\nset URL=https:\/\/moeclub.org\/attachment\/WindowsSoftware\n\n:InitCheck\nmkdir \"%SystemDrive%\\win32-loader\" &gt;NUL 2&gt;NUL\nif exist \"%SystemDrive%\\Windows\\System32\\WindowsPowerShell\" (\nset use_ps=1\n) else (\nset use_ps=0\necho Not found PowerShell.\n)\n\n:Init\nif %use_ps% equ 1 (\ngoto InitIt\n) else (\ngoto InitFail\n)\n\n:InitIt\nset try_download=0\ncall:DownloadFile \"!URL!\/g2ldr\/g2ldr\",\"%SystemDrive%\\g2ldr\"\ncall:DownloadFile \"!URL!\/g2ldr\/g2ldr.mbr\",\"%SystemDrive%\\g2ldr.mbr\"\ncall:DownloadFile \"!URL!\/g2ldr\/grub.cfg\",\"%SystemDrive%\\win32-loader\\grub.cfg\"\ngoto InitDone\n\n:InitFail\necho.\necho Go to \"!URL!\/g2ldr\",\necho Please download them by yourself.\necho '%SystemDrive%\\g2ldr'\necho '%SystemDrive%\\g2ldr.mbr'\necho '%SystemDrive%\\win32-loader\\grub.cfg'\necho Press [ENTER] when you finished.\npause &gt;NUL 2&gt;NUL\ngoto InitDone\n\n:InitDone\nif !try_download! equ 0 (\nset InitOption=InitFail\n) else (\nset InitOption=Init\n)\nif not exist \"%SystemDrive%\\g2ldr\" goto !InitOption!\nif not exist \"%SystemDrive%\\g2ldr.mbr\" goto !InitOption!\nif not exist \"%SystemDrive%\\win32-loader\\grub.cfg\" goto !InitOption!\n\n:Image\necho.\necho * Please select initrd mode.\necho     [1] Online download\necho     [2] Local file\nchoice \/n \/c 12 \/m Select:\nif errorlevel 2 goto LocalMode\nif errorlevel 1 goto OnlineMode\ngoto Image\n\n:OnlineMode\necho.\necho * Please select source.\necho     [1] by MoeClub [Linux](Debian8, DHCP or VNC Support)\necho     [2] by MoeClub [Windows](Win7EMB, DHCP or VNC Support)\necho     [3] by MoeClub [Windows](Win8.1EMB, DHCP or VNC Support)\necho     [4] by yourself\nchoice \/n \/c 1234 \/m Select:\nif errorlevel 4 goto Yourself\nif errorlevel 3 goto MoeClub_Win8.1EMB\nif errorlevel 2 goto MoeClub_Win7EMB\nif errorlevel 1 goto MoeClub\ngoto OnlineMode\n:Yourself\necho.\necho if 'initrd.img' URL is 'https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/DebianJessie\/initrd.img', \necho Please input 'https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/DebianJessie'.\nset \/p IMG_URL_TMP=URL :\nif defined IMG_URL_TMP (\nset IMG_URL=%IMG_URL_TMP%\ngoto Download\n) else (\ngoto MoeClub\n)\n:MoeClub_Win8.1EMB\nset IMG_URL=https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/Win8.1EMB\nset INITRD_SHA1=473617320316CCB5A88EDE72CBA6AF501B148071\nset VMLINUZ_SHA1=C84BF89869868B0325F56F1C0E62604A83B9443F\ngoto Download\n:MoeClub_Win7EMB\nset IMG_URL=https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/Win7EMB\nset INITRD_SHA1=C1BF2A50802BC23A7EC7373AB4CB8F5A905D5860\nset VMLINUZ_SHA1=C84BF89869868B0325F56F1C0E62604A83B9443F\ngoto Download\n:MoeClub\nset IMG_URL=https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/DebianJessie\nset INITRD_SHA1=934CFCD5DC855F360AE72AFCB8E6276FABFBCDD5\nset VMLINUZ_SHA1=C84BF89869868B0325F56F1C0E62604A83B9443F\ngoto Download\n:Download\nif %use_ps% equ 1 (\necho.\necho Downloading 'initrd.img'...\ncall:DownloadFile \"!IMG_URL!\/initrd.img\",\"%SystemDrive%\\win32-loader\\initrd.img\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\initrd.img\"\ncall:CheckSUM \"%SystemDrive%\\win32-loader\\initrd.img\",\"%INITRD_SHA1%\"\necho Downloading 'vmlinuz'...\ncall:DownloadFile \"!IMG_URL!\/vmlinuz\",\"%SystemDrive%\\win32-loader\\vmlinuz\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\vmlinuz\"\ncall:CheckSUM \"%SystemDrive%\\win32-loader\\vmlinuz\",\"%VMLINUZ_SHA1%\"\nset download=1\n) else (\necho Not support online download, auto change Local initrd.\ngoto LocalMode\n)\n\n:LocalMode\nif !download! equ 0 (\necho.\necho Please put 'initrd.img' and 'vmlinuz' to '%SystemDrive%\\win32-loader' .\necho Press [ENTER] when you finished.\npause &gt;NUL 2&gt;NUL\n)\n\n:Done0\nset download=0\nif exist \"%SystemDrive%\\win32-loader\\initrd.img\" (\ngoto Done1\n) else (\necho Not found '%SystemDrive%\\win32-loader\\initrd.img' .\ngoto LocalMode\n)\n\n:Done1\nset download=0\nif exist \"%SystemDrive%\\win32-loader\\vmlinuz\" (\ngoto Done\n) else (\necho Not found '%SystemDrive%\\win32-loader\\vmlinuz' .\ngoto LocalMode\n)\n\n:Done\necho.\necho Press [ENTER] to continue...\necho IT WILL REBOOT IMMEDIATELY\npause &gt;NUL 2&gt;NUL\necho.\ncall:CheckFile \"%SystemDrive%\\g2ldr\"\ncall:CheckFile \"%SystemDrive%\\g2ldr.mbr\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\grub.cfg\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\initrd.img\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\vmlinuz\"\ncall:CheckSUM \"%SystemDrive%\\g2ldr\",\"2FCB1009A64C127AD3CC39FF0B5E068B38CBA772\"\ncall:CheckSUM \"%SystemDrive%\\g2ldr.mbr\",\"29401C8BC951F0AEFD30DC370A3797D1055D64B4\"\ncall:CheckSUM \"%SystemDrive%\\win32-loader\\grub.cfg\",\"58C499EFEE7E60790B3FE2166B536C04B6717B14\"\nset id={01234567-89ab-cdef-fedc-ba9876543210}\nbcdedit \/create %id% \/d \"Debian GUN\/Linux\" \/application bootsector &gt;NUL 2&gt;NUL\nbcdedit \/set %id% device partition=%SystemDrive% &gt;NUL 2&gt;NUL\nbcdedit \/set %id% path \\g2ldr.mbr &gt;NUL 2&gt;NUL\nbcdedit \/displayorder %id% \/addlast &gt;NUL 2&gt;NUL\nbcdedit \/bootsequence %id% \/addfirst &gt;NUL 2&gt;NUL\nshutdown -r -t 0\n\n:CheckSUM\nfor \/f \"delims=: tokens=2\" %%i in ('powershell.exe \"&amp; {Get-FileHash -Algorithm SHA1 -Path %1|Format-List -Property HASH}\"') do (set tmp_var=%%i)\nset var=%tmp_var:~1%\nif \"%var%\" == %2 (\necho Check %1 SHA1 OK.\n) else (\nif \"%var%\" == \"CommandNotFoundException\" (\necho Check %1 SHA1 SKIP.\n) else (\necho Check %1 SHA1 FAIL.\ncall:ErrorExit\n)\n)\nGOTO:EOF\n\n:CheckFile\nif not exist %1 (\necho Not found %1 .\ncall:ErrorExit\n)\nGOTO:EOF\n\n:DownloadFile\npowershell.exe -command \"&amp; {$client = new-object System.Net.WebClient; $client.DownloadFile('%1','%2')}\" &gt;NUL 2&gt;NUL\nGOTO:EOF\n\n:ErrorExit\necho. \necho Error, Clear CACHE...\ndel \/S \/F \/Q \"%SystemDrive%\\g2ldr\" &gt;NUL 2&gt;NUL\ndel \/S \/F \/Q \"%SystemDrive%\\g2ldr.mbr\" &gt;NUL 2&gt;NUL\nrd \/S \/Q \"%SystemDrive%\\win32-loader\" &gt;NUL 2&gt;NUL\necho Press [ENTER] to exit.\npause &gt;NUL 2&gt;NUL\nexit 1\nGOTO:EOF<\/pre>\n<p>&nbsp;<\/li>\n<li>\u53cc\u51fb\u6253\u5f00\u6b64\u6587\u4ef6.<\/li>\n<li>\u81ea\u884c\u9009\u62e9\u9009\u9879.<\/li>\n<li>\u6309\u56de\u8f66\u91cd\u542f,\u5e76\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li><strong>\u6ce8\u610f\u4e8b\u9879:<\/strong>\n<ul>\n<li>\u5982\u679c\u5bf9\u63d0\u4f9b\u5b89\u88c5\u7684\u53d1\u884c\u7248\u4e0d\u6ee1\u610f,\u8bf7\u53c2\u8003\u6b64\u6587\u7ae0.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><u><a href=\"https:\/\/moeclub.org\/2018\/04\/03\/603\/\" target=\"_blank\" rel=\"noopener noreferrer\">[ Linux VPS ] Debian\/Ubuntu\/CentOS \u7f51\u7edc\u5b89\u88c5\/\u91cd\u88c5\u7cfb\u7edf\/\u7eaf\u51c0\u5b89\u88c5 \u4e00\u952e\u811a\u672c<\/a><\/u><br \/>\n\u9ed8\u8ba4\u63d0\u4f9b\u7684\u662fDebian8(Jessie),\u6dfb\u52a0\u4e86firmware\u5305,\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u9a71\u52a8\u652f\u6301,DHCP\u6a21\u5f0f\u4e00\u952e.<br \/>\n\u975eDHCP\u6a21\u5f0f,\u5982\u679c\u8981\u4e00\u952e,\u5219\u9700\u8981\u81ea\u5df1\u5b9a\u5236\u955c\u50cf.<br \/>\n\u5b9a\u5236Debian\u7cfb\u955c\u50cf\u5e94\u8be5\u6ca1\u95ee\u9898,\u5176\u4ed6\u672a\u4f5c\u6d4b\u8bd5.<br \/>\n\u9ed8\u8ba4<strong>root<\/strong>\u8d26\u6237\u5bc6\u7801\u00a0<u><strong>Vicer<\/strong><\/u>\u00a0.<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>\u5982\u9700\u8981Linux\u4e00\u952e\u91cd\u88c5\u4e3aWindows,\u8bf7\u53c2\u8003\u6b64\u6587\u7ae0.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><u><a href=\"https:\/\/moeclub.org\/2018\/04\/03\/603\/\" target=\"_blank\" rel=\"noopener noreferrer\">[ Linux VPS ] Debian\/Ubuntu\/CentOS \u7f51\u7edc\u5b89\u88c5\/\u91cd\u88c5\u7cfb\u7edf\/\u7eaf\u51c0\u5b89\u88c5 \u4e00\u952e\u811a\u672c<\/a><\/u><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>\u5982\u679c\u5382\u5546\u4e0d\u652f\u6301VNC,\u5219\u9700\u8981\u81ea\u5df1\u5b9a\u5236\u955c\u50cf.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5b9a\u5236\u65b9\u6cd5\u53c2\u8003\u4e0a\u9762\u63d0\u5230\u7684\u6587\u7ae0<br \/>\n<u><a href=\"https:\/\/moeclub.org\/2018\/04\/03\/603\/\" target=\"_blank\" rel=\"noopener noreferrer\">[ Linux VPS ] Debian\/Ubuntu\/CentOS \u7f51\u7edc\u5b89\u88c5\/\u91cd\u88c5\u7cfb\u7edf\/\u7eaf\u51c0\u5b89\u88c5 \u4e00\u952e\u811a\u672c<\/a><\/u><br \/>\n\u4e3b\u8981\u5728\u955c\u50cf\u4e2d\u6dfb\u52a0\u673a\u5668\u7684\u7f51\u7edc\u53c2\u6570,\u4ee5\u4fbf\u652f\u6301\u4e00\u952e\u5b89\u88c5.<br \/>\n\u547d\u4ee4\u793a\u4f8b:<\/p>\n<pre class=\"lang:default decode:true \"># \u5b9a\u5236\u5e26\u7f51\u7edc\u53c2\u6570\u7684initrd.img\nbash InstallNET.sh -d 8 -v 64 -a --ip-addr &lt;IP&gt; --ip-mask &lt;NetMask&gt; --ip-gate &lt;GATE&gt; --loader\n# \u9700\u8981dd\u5b89\u88c5\u5176\u4ed6\u7cfb\u7edf(\u4f8b\u5982 Windows to Windows),\u5b9a\u5236\u547d\u4ee4.(\u7f51\u7edc\u53c2\u6570\u6709DHCP\u7684,\u65e0\u9700\u6dfb\u52a0.)\nbash InstallNET.sh -dd &lt;IMAGE_URL.tar&gt; --ip-addr &lt;IP&gt; --ip-mask &lt;NetMask&gt; --ip-gate &lt;GATE&gt; --loader<\/pre>\n<p><strong>\u5b8c\u6210\u540e\u5c06\u00a0<code>initrd.img<\/code>\u00a0\u548c\u00a0<code>vmlinuz<\/code>\u00a0\u5b58\u653e\u5230\u80fd\u76f4\u94fe\u4e0b\u8f7d\u7684\u4f4d\u7f6e.<\/strong><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>\u5982\u679c\u5382\u5546\u652f\u6301VNC,\u5219\u53ef\u4ee5\u76f4\u9009\u5168\u90e8\u9009\u00a0<strong>1<\/strong>\u00a0.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5b89\u88c5\u7684\u65f6\u5019,\u81ea\u5df1\u586b\u00a0<strong>IP\u5730\u5740<\/strong>\uff0c<strong>\u5b50\u7f51\u63a9\u7801<\/strong>,\u00a0<strong>\u7f51\u5173<\/strong>,\u00a0<strong>DNS\u670d\u52a1\u5668<\/strong>.<br \/>\nDNS\u670d\u52a1\u5668\u63a8\u8350\u586b:\u00a0<code>8.8.8.8<\/code><\/p>\n<ul>\n<li>\u533a\u5206\u662f\u5426\u4e3aDHCP\u6a21\u5f0f<\/li>\n<li><\/li>\n<li><strong>\u975eDHCP\u6a21\u5f0f<\/strong>: \u5982\u4e0a\u56fe,\u663e\u793a\u4e86\u8be6\u7ec6\u7684IP\u5730\u5740.(\u9009\u4e2d:<strong>\u4f7f\u7528\u4e0b\u9762\u7684IP\u5730\u5740<\/strong>)<\/li>\n<li><strong>DHCP\u6a21\u5f0f<\/strong>: \u53c2\u8003\u4e0a\u56fe.(\u9009\u4e2d:<strong>\u81ea\u52a8\u83b7\u5f97IP\u5730\u5740<\/strong>)<\/li>\n<li><strong>win32loader.bat:<\/strong><\/li>\n<li>\n<pre class=\"lang:default decode:true \">@ECHO OFF&amp;@PUSHD %~DP0 &amp;TITLE Win32Loader\nsetlocal enabledelayedexpansion\n::Author MoeClub.org\ncolor 87\ncd.&gt;%windir%\\GetAdmin\nif exist %windir%\\GetAdmin (del \/f \/q \"%windir%\\GetAdmin\") else (\necho CreateObject^(\"Shell.Application\"^).ShellExecute \"%~s0\", \"%*\", \"\", \"runas\", 1 &gt;&gt; \"%temp%\\Admin.vbs\"\n\"%temp%\\Admin.vbs\"\ndel \/s \/q \"%temp%\\Admin.vbs\"\nexit \/b 2)\ncls\n \necho * Init Win32Loader.\nset download=0\nset try_download=1\nset URL=https:\/\/moeclub.org\/attachment\/WindowsSoftware\n \n:InitCheck\nmkdir \"%SystemDrive%\\win32-loader\" &gt;NUL 2&gt;NUL\nif exist \"%SystemDrive%\\Windows\\System32\\WindowsPowerShell\" (\nset use_ps=1\n) else (\nset use_ps=0\necho Not found PowerShell.\n)\n \n:Init\nif %use_ps% equ 1 (\ngoto InitIt\n) else (\ngoto InitFail\n)\n \n:InitIt\nset try_download=0\ncall:DownloadFile \"!URL!\/g2ldr\/g2ldr\",\"%SystemDrive%\\g2ldr\"\ncall:DownloadFile \"!URL!\/g2ldr\/g2ldr.mbr\",\"%SystemDrive%\\g2ldr.mbr\"\ncall:DownloadFile \"!URL!\/g2ldr\/grub.cfg\",\"%SystemDrive%\\win32-loader\\grub.cfg\"\ngoto InitDone\n \n:InitFail\necho.\necho Go to \"!URL!\/g2ldr\",\necho Please download them by yourself.\necho '%SystemDrive%\\g2ldr'\necho '%SystemDrive%\\g2ldr.mbr'\necho '%SystemDrive%\\win32-loader\\grub.cfg'\necho Press [ENTER] when you finished.\npause &gt;NUL 2&gt;NUL\ngoto InitDone\n \n:InitDone\nif !try_download! equ 0 (\nset InitOption=InitFail\n) else (\nset InitOption=Init\n)\nif not exist \"%SystemDrive%\\g2ldr\" goto !InitOption!\nif not exist \"%SystemDrive%\\g2ldr.mbr\" goto !InitOption!\nif not exist \"%SystemDrive%\\win32-loader\\grub.cfg\" goto !InitOption!\n \n:Image\necho.\necho * Please select initrd mode.\necho     [1] Online download\necho     [2] Local file\nchoice \/n \/c 12 \/m Select:\nif errorlevel 2 goto LocalMode\nif errorlevel 1 goto OnlineMode\ngoto Image\n \n:OnlineMode\necho.\necho * Please select source.\necho     [1] by MoeClub [Linux](Debian8, DHCP or VNC Support)\necho     [2] by MoeClub [Windows](Win7EMB, DHCP or VNC Support)\necho     [3] by MoeClub [Windows](Win8.1EMB, DHCP or VNC Support)\necho     [4] by yourself\nchoice \/n \/c 1234 \/m Select:\nif errorlevel 4 goto Yourself\nif errorlevel 3 goto MoeClub_Win8.1EMB\nif errorlevel 2 goto MoeClub_Win7EMB\nif errorlevel 1 goto MoeClub\ngoto OnlineMode\n:Yourself\necho.\necho if 'initrd.img' URL is 'https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/DebianJessie\/initrd.img', \necho Please input 'https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/DebianJessie'.\nset \/p IMG_URL_TMP=URL :\nif defined IMG_URL_TMP (\nset IMG_URL=%IMG_URL_TMP%\ngoto Download\n) else (\ngoto MoeClub\n)\n:MoeClub_Win8.1EMB\nset IMG_URL=https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/Win8.1EMB\nset INITRD_SHA1=473617320316CCB5A88EDE72CBA6AF501B148071\nset VMLINUZ_SHA1=C84BF89869868B0325F56F1C0E62604A83B9443F\ngoto Download\n:MoeClub_Win7EMB\nset IMG_URL=https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/Win7EMB\nset INITRD_SHA1=C1BF2A50802BC23A7EC7373AB4CB8F5A905D5860\nset VMLINUZ_SHA1=C84BF89869868B0325F56F1C0E62604A83B9443F\ngoto Download\n:MoeClub\nset IMG_URL=https:\/\/moeclub.org\/onedrive\/IMAGE\/Loader\/DebianJessie\nset INITRD_SHA1=934CFCD5DC855F360AE72AFCB8E6276FABFBCDD5\nset VMLINUZ_SHA1=C84BF89869868B0325F56F1C0E62604A83B9443F\ngoto Download\n:Download\nif %use_ps% equ 1 (\necho.\necho Downloading 'initrd.img'...\ncall:DownloadFile \"!IMG_URL!\/initrd.img\",\"%SystemDrive%\\win32-loader\\initrd.img\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\initrd.img\"\ncall:CheckSUM \"%SystemDrive%\\win32-loader\\initrd.img\",\"%INITRD_SHA1%\"\necho Downloading 'vmlinuz'...\ncall:DownloadFile \"!IMG_URL!\/vmlinuz\",\"%SystemDrive%\\win32-loader\\vmlinuz\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\vmlinuz\"\ncall:CheckSUM \"%SystemDrive%\\win32-loader\\vmlinuz\",\"%VMLINUZ_SHA1%\"\nset download=1\n) else (\necho Not support online download, auto change Local initrd.\ngoto LocalMode\n)\n \n:LocalMode\nif !download! equ 0 (\necho.\necho Please put 'initrd.img' and 'vmlinuz' to '%SystemDrive%\\win32-loader' .\necho Press [ENTER] when you finished.\npause &gt;NUL 2&gt;NUL\n)\n \n:Done0\nset download=0\nif exist \"%SystemDrive%\\win32-loader\\initrd.img\" (\ngoto Done1\n) else (\necho Not found '%SystemDrive%\\win32-loader\\initrd.img' .\ngoto LocalMode\n)\n \n:Done1\nset download=0\nif exist \"%SystemDrive%\\win32-loader\\vmlinuz\" (\ngoto Done\n) else (\necho Not found '%SystemDrive%\\win32-loader\\vmlinuz' .\ngoto LocalMode\n)\n \n:Done\necho.\necho Press [ENTER] to continue...\necho IT WILL REBOOT IMMEDIATELY\npause &gt;NUL 2&gt;NUL\necho.\ncall:CheckFile \"%SystemDrive%\\g2ldr\"\ncall:CheckFile \"%SystemDrive%\\g2ldr.mbr\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\grub.cfg\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\initrd.img\"\ncall:CheckFile \"%SystemDrive%\\win32-loader\\vmlinuz\"\ncall:CheckSUM \"%SystemDrive%\\g2ldr\",\"2FCB1009A64C127AD3CC39FF0B5E068B38CBA772\"\ncall:CheckSUM \"%SystemDrive%\\g2ldr.mbr\",\"29401C8BC951F0AEFD30DC370A3797D1055D64B4\"\ncall:CheckSUM \"%SystemDrive%\\win32-loader\\grub.cfg\",\"58C499EFEE7E60790B3FE2166B536C04B6717B14\"\nset id={01234567-89ab-cdef-fedc-ba9876543210}\nbcdedit \/create %id% \/d \"Debian GUN\/Linux\" \/application bootsector &gt;NUL 2&gt;NUL\nbcdedit \/set %id% device partition=%SystemDrive% &gt;NUL 2&gt;NUL\nbcdedit \/set %id% path \\g2ldr.mbr &gt;NUL 2&gt;NUL\nbcdedit \/displayorder %id% \/addlast &gt;NUL 2&gt;NUL\nbcdedit \/bootsequence %id% \/addfirst &gt;NUL 2&gt;NUL\nshutdown -r -t 0\n \n:CheckSUM\nfor \/f \"delims=: tokens=2\" %%i in ('powershell.exe \"&amp; {Get-FileHash -Algorithm SHA1 -Path %1|Format-List -Property HASH}\"') do (set tmp_var=%%i)\nset var=%tmp_var:~1%\nif \"%var%\" == %2 (\necho Check %1 SHA1 OK.\n) else (\nif \"%var%\" == \"CommandNotFoundException\" (\necho Check %1 SHA1 SKIP.\n) else (\necho Check %1 SHA1 FAIL.\ncall:ErrorExit\n)\n)\nGOTO:EOF\n \n:CheckFile\nif not exist %1 (\necho Not found %1 .\ncall:ErrorExit\n)\nGOTO:EOF\n \n:DownloadFile\npowershell.exe -command \"&amp; {$client = new-object System.Net.WebClient; $client.DownloadFile('%1','%2')}\" &gt;NUL 2&gt;NUL\nGOTO:EOF\n \n:ErrorExit\necho. \necho Error, Clear CACHE...\ndel \/S \/F \/Q \"%SystemDrive%\\g2ldr\" &gt;NUL 2&gt;NUL\ndel \/S \/F \/Q \"%SystemDrive%\\g2ldr.mbr\" &gt;NUL 2&gt;NUL\nrd \/S \/Q \"%SystemDrive%\\win32-loader\" &gt;NUL 2&gt;NUL\necho Press [ENTER] to exit.\npause &gt;NUL 2&gt;NUL\nexit 1\nGOTO:EOF<\/pre>\n<p>&nbsp;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\t\t\t\t\t\t&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"http:\/\/www.zhangyijun.com\/?p=119\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":0,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}