Sign in with
Sign up | Sign in
Your question

Cannot delete a folder con that contains another files

Last response: in Windows 8
Share
December 5, 2012 4:44:20 AM

Hello, i have created one folder with the command prompt named "con" but by mistake i have dropped a folder of mine in that "con" folder. so i am not able to delete folder "con" with the command prompt. which shows error that it "file not empty". suggest me how to delete the folder con by first empting the folder.
December 5, 2012 12:21:02 PM

raju9020 said:
Hello, i have created one folder with the command prompt named "con" but by mistake i have dropped a folder of mine in that "con" folder. so i am not able to delete folder "con" with the command prompt. which shows error that it "file not empty". suggest me how to delete the folder con by first empting the folder.

Delete the folder beneath the high level folder.
m
0
l
December 5, 2012 12:58:53 PM

If you want to wipe the folder clean you can use robocopy command to overwrite it with an empty folder. Let's say the folder you want to get rid of (with all the files inside) is located at C:\con all you need to do is open elevated command prompt, go back to C:\ root, create a new folder by typing 'MD new' without quotation marks, and then type in 'robocopy /mir C:\new C:\con'.

After doing so, your con folder should be removable by typing 'RMDIR /s /q C:\con' and 'RMDIR /s /q C:\new'

P.S. Be careful though, robocopy is a powerful tool that can wipe your system files if not used with caution, specifically the /mir flag.
m
0
l
Related resources
December 5, 2012 1:05:32 PM

should be able to do that from command prompt
use the cd swith to browse to the directory in each directory run dir /p
the use del and file name to empty directory

m
0
l
December 5, 2012 1:05:40 PM

should be able to do that from command prompt
use the cd swith to browse to the directory in each directory run dir /p
the use del and file name to empty directory

m
0
l
a b * Windows 8
December 5, 2012 3:56:07 PM

raju9020 said:
Hello, i have created one folder with the command prompt named "con" but by mistake i have dropped a folder of mine in that "con" folder. so i am not able to delete folder "con" with the command prompt. which shows error that it "file not empty". suggest me how to delete the folder con by first empting the folder.


LOL it is a artifact from the old DOS days. AUX, CON, and several other names have a special meaning to a Microsoft Operating system. For compatibility reasons Microsoft had to keep these names in each generation of OS that they produced.

-Later, Microsoft filtered out the creation of the names from the graphic UI but not from the command prompt. (remove them can break old .bat or cmd files)

Basically, these devices route control to a hardware device and any file extension is ignored. con = console files like con.txt also mean console
others if I remember are AUX, com, lpt, I think there were 8 of them.

-any file with these reserved file names will be sent to the device driver when they are copied, moved. Really screws up poorly written back up files.


you need to rename any folder that is using a reserved name or you will get
"crazy" results. like you copy a file and it goes to your old com (serial port)
rather than where you wanted it to go. or it goes to you con device (screen) in your case.
- it can be a pain to remove the name from the file system. Do yourself a favor and rename the directory before you attempt to remove it with utility.
m
0
l
a b * Windows 8
December 5, 2012 4:00:39 PM

Right click, delete. Why are you limited to only using a command prompt?
m
0
l
December 6, 2012 11:37:47 AM

Google/Wiki: 'Unlocker'.

:sol: 
m
0
l
!