How to delete GRUB files from a Boot EFI partition in Windows 10

After several failed attempts to dual-boot Ubuntu 15.04 and Windows 10 on a single hard drive and on a computer with UEFI firmware, and not knowing what caused the first failed attempt, I figured that subsequent failed attempts must have been due to an existing Ubuntu GRUB folder in the Boot EFI folder.

Especially since the machine always froze when the installer is attempting to install GRUB

So I thought that If I could just delete the ubuntu folder from the Boot EFI folder, that the installation would complete – successfully. Ultimately, it didn’t, but I figured out how to delete GRUB files from inside Windows 10, from the command line.

This post documents how it was done. It involved, from the command line, listing and selecting the detected hard drives, listing the partitions on the hard drive, then, finally, listing and deleting the target folder. Another reason you might want to do this, is if you deleted the Linux partitions, which would not automatically delete the GRUB files from the Boot EFI folder.

To start, log into Windows 10, click on the menu and type cmd. Then right-click on the terminal application’s icon and select run as administrator. Figure 1 show the commands (underlined) used to accomplish the first step – listing and selecting the hard drive. To make it possible to copy-and-paste, for those who might need to, I’ve provided the commands in the code block after the last image.

Related Post:  How Blockchain technology will change online and offline gambling

In this figure, the target disk is shown as a 465 GB hard drive, with GPT partition.

Windows 10 diskpart
Figure 1: Using diskpart to list hard drives detected on Windows 10

After the target disk has been selected, its partitions are listed, so that the partition (volume) that corresponds to the Boot EFI folder can be identified. In Figure 2, that partition is Volume 2. It’s usually the only volume with FAT32 in the Fs (file system) column, and System in the Info column. After it has been identified and selected, you assign it a drive letter to make it easier to work with. In this example, I assigned it a drive letter D. After that, exit diskpart.

Listing Windows 10 partitions
Figure 2: Listing disk partitions on Windows 10

The final task involves changing into the Boot EFI folder, listing its contents to identify what subfolder the GRUB files would be. It will be in the EFI folder. The GRUB files for the distribution that was installed will be under a folder of the same name as the distribution. For example, if Ubuntu was installed, as in this example, the name of the folder will be ubuntu. Delete the folder using the rmdir /s command. That’s the Windows 10 equivalent of the Unix/Linux rm -r command.

Delete Ubuntu Boot EFI GRUB files
Figure 3: Deleting non-empty Ubuntu GRUB directory in Windows 10

All the commands used are given in this code block. Note that this procedure is not necessarily the best or only way to go about do this, so if you know of a better method, post a comment.

Related Post:  Deploying Machine Learning workloads in Kubernetes clusters that support GPUs

Please share:

We Recommend These Services

Register now for Big Data & AI Conference, international Big Data and AI conference in Dallas, TX (USA), June 27 - 29, 2019

Reasons to use control panel for your server

Register for the End-to-end Machine Learning with TensorFlow on Google Cloud Platform workshop. It will be conducted by the manager of Google's Cloud AI Advocacy team

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).


  1. Vinay kumar

    Thanks a lot

  2. Thanks it really helped.

  3. Very practical tutorial!

  4. Thanks dude

  5. thanks man, you save my life

  6. Well Linux Mint is gone off the computer now (back to the horrid Win 10) but the Linux swap file still remains. Any idea how to get rid of that hidden and unusable partition. 300 mb is a lot of disk space to lose / not have available.

    • If you created a swap on Mint, then deleted the entire Mint partition, then the swap file is gone too. If you instead referring to a swap partition for Mint, then you just need to delete that too. You can accomplish that from the Windows partition manager.

  7. It works:) Thanks

  8. I get a ” positional parameter cannot be found that accepts argument ‘ubuntu’.
    when I typed rmdir /s ubuntu . I had removed the ubuntu partition from disk management and all the commands shown in this article worked until the last one. Is there a suggestion ?

  9. Thanks it Works.

  10. but i followed those three images, when i came the third image second command, which is ‘ls’ my command prompt showing ‘ls’ is not recognized as an internal or external command,
    operable program or batch file. please help me

  11. Its working dude thx a lot. Have some sosial medias? 😀

  12. Hi, I was deleted the linux partition and rebooted my system now my PC always goes to (error: unknown file system entering rescue mod) any solution? Please help I’m waiting for your reply…

    • Perhaps you deleted the wrong partition. What is the default boot manager in the BIOS/UEFI utility? It’s likely GRUB, so try changing it to Windows Boot Manager and reboot.

      • Hey,
        Whenever I boot I’m getting an error that flashes away immediately. I have deleted the “Ubuntu” folder from that drive, and after a reboot, I got that error. I can’t do anything now. I need this working ASAP, so any help would be appreciated!

        I seem unable to enter the BIOS. as well…

    • Hi,

      Getting the same problem here. I literally can’t use my laptop now, and I need it a LOT.
      Please respond ASAP, as I need it working ASAP.


  13. Arunalu Kariyawasam

    Minor detail, but: in the image where you show the commands to delete EFI, you put ‘ls’ as the command instead of ‘dir’.

  14. Thanku my pc is not booting in kali ao i delete it and reinstall .now it’s working.

Leave a Reply to darkcoderpca Cancel

Your email address will not be published. Required fields are marked *