Unable to Delete Virtual box folder

I have an Oracle  Virtualbox  ( A folder MyVirtual  with only a .VDI file in it  which  I thought can  run as a Virtual machine) .  After I ran it , at somepoint it seems some "Mounting Image" occured and a new  (probably Virtual)  Drive F  is created  with contents as shown in Snapshot ( I am not 100% sure on what caused it )

When now, I am unable to  delete  the folder MyVirtual  .    How Can  delete the folder MyVirtual and the new  Drive F that is created ( In short how can I go back  with my Machine to the state before I started with copying the MyVirtual folder )
Sam OZAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sajid Shaik MSystem AdminCommented:
go to settings - shared Folder if there is anything delete it...  and
settings - General - Advanced - check the snapshots location and delete them...

then try ...

all the best
Sam OZAuthor Commented:
Hi sajid ,

   Thanks. But did you mean to right click the  folder ( or the .vdi file)   and look for sharing ?
    The folder is not  shared .

  Also I don't see anything like snapshit location from General - Advanced

Did you mean something totally different ?
I don't understand exactly what the situation is. Can you show some screenshots of the VM and how the disk image is mounted?
SolarWinds® IP Control Bundle (IPCB)

Combines SolarWinds IP Address Manager and User Device Tracker to help detect IP conflicts, quickly identify affected systems, and help your team take near instantaneous action. Help improve visibility and enhance reliability with SolarWinds IP Control Bundle.

noxchoGlobal Support CoordinatorCommented:
Is the virtual machine running or in sleep mode? Turn it completely off. Then in running tasks disable all virtual box services, after that you should be able to delete it.
Sam OZAuthor Commented:
I will explain the situation

     For Virtual box there is a .VDI file ( in case of VMWare it is .VMDK)   that ,I believe , is the Virtual HardDisk.  
     I had copied a Virtualbox in a folder MyVirtual ,  and I clicked on the .VDI file , by mistake.  It mounted an additional Disk  F (looks like a Virtual drive )
     But now, I am unable to delete the  folder MyVirtual . Also I don't know how I can delete the newly created  Disk F ( I have formatted it)
 ( Note: same thing will happen if you  click .VMDK file for VMWare )
David Johnson, CD, MVPOwnerCommented:
perhaps the drive was mounted in your operating system.
from an elevated command prompt
then right click on the virtual disk (in blue) not the clear disks and detach vhd
Top is physical disk, bottom is virtual disk
Sam OZAuthor Commented:
I deleted the  Drive. But still unable to delete the Virtualbox Folder
David Johnson, CD, MVPOwnerCommented:
from an elevated command prompt do a 'dir /ah' as there may be some hidden files or go one folder up. i.e.
one way is to do a dir c:\abc\folderIcan'tdelete\ /aa you may see files in there
del folderIcan'tdelete
rd c:\abc\folderIcan'tdelete
The directory is not empty
attrib -s "folderIcan'tdelete\*" /s /d        // this removes the system attribute  /s includes subfolders and directories
attrib -h folderIcan'tdelete\* /s         // this remove the hidden attribute
rd folderIcan'tdelete /s   (with a prompt) or
rd folderIcan'tdelete /s/q  (no prompt)
Sam OZAuthor Commented:
Hi Thanks David .  I tried. But the   del command doesn't delete .  It says "The Process can't access the file because it is used by another process"   ( This is the  same error I was getting when I tried to delete the folder with mouse )
David Johnson, CD, MVPOwnerCommented:
use sysinternals process explorer
1. Open procexp.exe as an administrator  from your disk or directly from http://live.sysinternals.com/procexp.exe.
2. Click Find –> Find Handle or DLL… or hit Ctrl-F
3. Enter the name of the file you would like to unlock and hit “Search”.
4. Select the first handle in the search result window. When selected, the handle will be highlighted in the bottom window.
5. Right click the handle in the bottom window and select “Close Handle”. Confirm the warning and repeat for every handle in the search result list.
 now delete the folder

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sam OZAuthor Commented:
Wow!!! Yes it did work. Thanks
David Johnson, CD, MVPOwnerCommented:
what was holding it captive?
Sam OZAuthor Commented:
DiscSoftbusService .. Don't know what that means
David Johnson, CD, MVPOwnerCommented:
Daemontools installed on this machine? part of it
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.