Skip to content

Instantly share code, notes, and snippets.

@erm3nda
Last active December 21, 2019 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erm3nda/108ee48cf3f9f2ab6db9e54fe2d6ffdb to your computer and use it in GitHub Desktop.
Save erm3nda/108ee48cf3f9f2ab6db9e54fe2d6ffdb to your computer and use it in GitHub Desktop.
Windows reboot to Linux using grub.bak file
@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