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:  Feature preview of Fedora 16 installer

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.

## These commands are used to identify and select the hard drive


list disk

sel disk 0

## These commands are used to list the partitions, select the Boot EFI partition, 
## then assign it a drive letter

list vol

sel vol 2

assign letter=D:


## These commands are used to change into the Boot EFI folder and delete the GRUB folder

cd /d D:


ls EFI

cd EFI


rmdir /s ubuntu


Share on facebook
Share on twitter
Share on pinterest
Share on linkedin

Hola! Did you notice that no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

179 Responses

  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. 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.

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

    1. 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

    1. 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

  4. 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?

    1. Hi to get around this in windows search for “cmd” when it shows up, right click and select run as administrator. Hope this helps.

  5. 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.

  6. 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?

  7. 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 🙂

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

  8. 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?

  9. 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”.

  10. 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.

  11. 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.

  12. 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 Anonymous Cancel reply

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

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.


The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.