Delete file/folder

Are there any ways on how to delete a FOLDER or FILE that is EMPTY or CAN'T be accessed anynmore? The folder is located on the server and we would like to delete the folder. But we tried to delete it, but failed. We set FULL Option for Everyone already for that folder, but still failed to delete. Even renaming the folder doesn't work. We tried to delete it from the server, so its the Administrator account already, but still failed to delete.
Even delete it using DOS Prompt, no work.

Are there any options on how to delete this kind of folders or files?
Because I'm doing ROBOCOPY from the server, but stuck on that part, in whereas found problem with 1 file inside that folder.

Stiebel EltronAsked:
Who is Participating?
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.

ran into a similar problem today... went to the folder in DOS, and did a dir /x and that showed me the msdos name of the folder, then I typed rmdir <8characterfoldername> ... so if it's called tempor~1, then you'd type rmdir tempor~1.... hope this works for you
Things to try:

- Have you tried hitting refresh on the folder to see if it's already gone?

- Did you make sure the folder's properties aren't set to read-only

- You could try deleting the folder/file with some simple VBA code in an Excel workbook (see example sub procedure)

There's probably a better way to do it, but those are some starters you can try...

Sub DeleteFolder()
      Kill "C:\folder"
End Sub

Open in new window

Is this windows 2003 server? if so there is a tool called "takeown" that will allow you to take ownership of the folder and it's contents,and then delete it.  Curiously when I have set permission via the gui I was still not able to delete folders that I should have had permissions to delete. Not Server 2003?? boot into safemode, or off a dos bootdisk, navigate to the folder and make sure it is empty, you will not be able to delete the directory if it is not empty. In dos, or safe more you should be able to delete the folder safely.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

HainKurtSr. System AnalystCommented:
what message you get when you try to delete or rename? what kind of files you have inside the folder?
is path too deep? does it contain special characters inside?
HainKurtSr. System AnalystCommented:
you can use dos "dir /x" to see the actual 8.3 dos name
call attrib -r-h-s FileIName83.format
then try to delete

if does not help, reboot and try again...

if does not help, reboot and open in SafeMode...

still no luck, try later :)
Check directory ownership, change directory owner ship to administrator account and then delete it. Also try to delete it using del /F which is forcefull delete.

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
deroodeSystems AdministratorCommented:
Any chance that the folder is in a path that is too long (> 238 characters)? I have seen problems where doing anything with files or folders in long paths is impossible. Usually this happens after renaming folders lower in the directory tree. When this is the case can rename folders that are lower in the directory tree to a shorter name.
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
If you already tried to the delete the folder, but it is locked by another program (e.g. as it's working or last accessed directory), you are stuck now. You only can try to kill the corresponding handle. Free tools to do that are handle (command line) or ProcExp (GUI), both from (belongs to Microsoft now).

Stiebel EltronAuthor Commented:
If I want to delete the folder, it POP-UP an error message saying Make sure that the disk is not FULL or write-protected, and/or not in use by other. But no one is accessing that folder, and even the server can't delete that folder.

In ROBOCOPY, how can u skip a file that has problem? Bec. everytime it runs and found a file that can't be copied, it'll stuck there.
deroodeSystems AdministratorCommented:
With robocopy, use the Retry once, Wait one second option

Robocopy <source> <destination> /r:1 /w:1

Use robocopy /??? for most used options, read the accompanied documentation for all options.
Adam LeinssServer SpecialistCommented:
What's the name of the directory?  If it's something like COM, CON, AUX or has illegal charsacters, you will have to use special methods to delete 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
Microsoft DOS

From novice to tech pro — start learning today.