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 to boost the physical security posture of your Linux-powered computer

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:  5 things to do that will boost the security profile of your smartphone

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. Usually, I never put my comments on any of the solutions But this is one of the best solutions that anybody can easily understand.
    I hope, that I can install linux again, without any issues…

  2. Thank you, the first simple answer i got after searching for a solution and it worked!

  3. Yes. Thanks a lot. Thank GOD at last I found your post. I had to google a lot.

    But the ‘cd /d D:’ & ‘ls’ command don’t work for me.

    What I did from the 21st line of your code block
    >dir EFI
    >cd EFI
    Then from 31st line, the same.

  4. Hey! everything worked fine for me.
    I have the same doubt as @Richard
    But how can I remove de D: partiton from File Explorer.

    • you know that step where you used the “assign letter=D” command? Open another command line, and follow all the previous step, but when you get to this step, use “remove letter=D” instead.
      >sel disk 0
      >list vol
      >sel vol 2
      >remove letter=D

  5. Thank you very much!! But how i can remove the D: partition from my file explorer???

    • you know that step where you used the “assign letter=D” command? Open another command line, and follow all the previous step, but when you get to this step, use “remove letter=D” instead.
      >sel disk 0
      >list vol
      >sel vol 2
      >remove letter=D

  6. Hey,
    Much like Tessa, I get the Access Denied message when I try to enter the “cd /d D:” command. I have no idea how to continue.
    I have administrator rights on the Win10 installation I am using. I also have the same terminal window open that I started with initially.
    Should I try with PowerShell instead? Other suggestions?

  7. Elias Tenece

    Thank you so much! I almost gave Up man!! I literally couldn’t do anything whenever I tried booting from a live USB it started loading and got frozen. I couldn’t even open the command line so I could type the commands most people suggested.

  8. When I enter the ‘ls’ command I receive the answer : ‘ls’ is not recognized as an internal or external command, operable program or batch file. What can I do to fix it?

  9. Hey! Thank you so much! Im getting an error that says “access denied” when i try to do the last set of steps… do you have any suggestions? Thank you so much 🙂

    • “Access denied” means you don’t have the proper authorization do perform the task. Did you maintain the same terminal that you started initially?

  10. Hi – this worked great, but boot manager still has “kali” in it, when I press the screen goes black then goes back to the boot manager.
    its just a corrupted name now. any clue how I can fix it?

  11. Thanks a million, after hours of struggle savior rescues me and now I have a grub free computer. I did this on windows 8.1 and replaced the “ls” command with “dir”.

  12. M Salman Tariq

    Thank you so much man it worked finally after looking for many other tutorials.

    However the “ls” command didnt work and wasnt recognized as internal or extranal command so i directly tied cd EFI and first deleted ubuntu and then grub as well.

    what caused this was the fact that i deleted ubuntu and merged the partitions but in EFI the grub and ubuntu remained and hence grub loaded instead of windows, now that grub and ubuntu are both gone now only Windows 10 loads.

    Thanks again.

  13. Great tutorial. It solved my problem. This is the easiest method it can be scariest for some people though. Other option is through USB recovery disk.

  14. Thank you, after going through all other websites and videos, this worked for me!!!! Thanks once again

  15. Gosh you do suggest a complex undertaking!. I have a 64bit dual boot win 10 preview (the penultimate one) and good old lubuntu 14.04. I downloaded the .iso for win10 (build 10264 or somesuch) and created a bootable usb using rufus.exe. Then I opened the usb and deleted the UEFI folder, and another UEFI subfolder.
    Closing down and rebooting from a usb with bootable lubuntu 14.04, the main drive was formatted to FAT32. Closing down again, the system was rebooted from the bootable win10 usb, and win10 installed (25 character product key was required).
    The result was a system with 300Mb legacy (not UEFI) boot partition and the rest devoted to win10. From there it was just the usual downsize the win10 partition (it was left with 40Gb on a 120Gb ssd) and install lubuntu 14.04.3 in the 80Gb empty space, which the usb recognised automatically.
    So, this method ‘misses out’ on the advantages (???) of UEFI. But once you have your dual-boot system running, in win10 go to then and switch off/over-ride all the ‘hibernate’ and ‘sleep’ options. When you reboot into linux, your win10 partition should be totally accessible. Whereas with a UEFI boot partition, and/or sleep/hibernate options enabled, linux finds it difficult to work with win10

Leave a Reply to Yuga Cancel

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