Last active
December 21, 2019 19:23
-
-
Save erm3nda/108ee48cf3f9f2ab6db9e54fe2d6ffdb to your computer and use it in GitHub Desktop.
Windows reboot to Linux using grub.bak file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: This program needs the following things to work | |
:: sed with some dll dependancies -> https://mega.nz/#!IRY0hCCK!tV5vZd3rsmTf6ZCrx-JfP8MpN9ztYfDHxtXVdDBbtbw | |
:: LinuxFS by Paragon -> http://dl.paragon-software.com/demo/linuxwin_trial.msi :: Trial just slow down speed, is OK for us | |
:: You have to boot into Linux and save current grubenv as grubenv.bak, otherwise grub will load saved one | |
"C:\Program Files (x86)\Paragon Software\LinuxFS for Windows\extmounter" /mount disk1 D: | |
:CheckForFile | |
IF EXIST "D:\boot\grub\grubenv" GOTO FoundIt | |
GOTO CheckForFile | |
:FoundIt | |
find "next_entry" D:/boot/grub/grubenv || cp "D:/boot/grub/grubenv.bak" "D:/boot/grub/grubenv" || echo "Cannot perform, rebooting" | |
"C:\Program Files (x86)\Paragon Software\LinuxFS for Windows\extmounter" /umount disk1 D: | |
shutdown -r -t 00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment