Open PowerShell as Administrator
mountvol S: /S
S:
cd .\EFI\
dir
Remove-Item -Recurse ubuntu
Enter powershell into the windows search of the start menu. Look for a blue icon with the label "Windows PowerShell", right click on the that and select "Run as Administrator" within the context menu.
To Mount the EFI System Partition on the given drive use the mountvol command by using the /S parameter. You can chose any free drive letter you want. For example "S".
mountvol S: /S
Now the partition is mounted. We can access the mounted volume by changing to the drive by the cd command and the drive letter S: as parameter
cd S:
To ensure we are at the root of this volume we should execute:
cd\
Type via the dir command to list the entries of the current path to ensure you on the right one.
dir
It should look like this:
Directory: S:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2019-01-17 12:55 EFI
-a---- 2018-10-16 10:57 31 startup.nsh
Your boot loaders are location in the EFI directory. Change to it by using the cd command and list the entries via the dir command.
cd .\EFI\
dir
Your output depends on the boot loaders you have installed, here is a example with Windows and Ubuntu.
Directory: S:\EFI
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2018-12-06 06:55 Ubuntu
d----- 2018-12-05 05:21 Microsoft
d----- 2019-01-17 12:55 Boot
Now you can delete unwanted loaders via the command Remove-Item and the parameter -Recurse.
DO NOT DELETE THE BOOT DIRECTORY OR THE WINDOWS DIRECTORY!
Remove-Item -Recurse ubuntu