Cannot Delete Directory

  • Thread starter Flavius Vespasianus
  • Start date
F

Flavius Vespasianus

On my system, some application has created a directory that I cannot
remove. It appears the directory name contains spaces. I have found some KB
articles dealing with this but none contains a solution.

Does anyone know how to delete such files, programatically if necessary?
 
P

Pegasus \(MVP\)

Flavius Vespasianus said:
On my system, some application has created a directory that I cannot
remove. It appears the directory name contains spaces. I have found some KB
articles dealing with this but none contains a solution.

Does anyone know how to delete such files, programatically if necessary?

What is the name of this directory?
 
P

Pegasus \(MVP\)

Flavius Vespasianus said:
It looks like

VMS201 followed by a number of spaces.

- Start a Command Prompt.
- Naviage to the parent directory of the problem directory.
- Type this command: dir vms2001*.*
- Convince yourself that nothing other than the problem
directory answers to this wildcard description.
- Type this command:
for /d %a in (vms2001*.*) do rd /s /q "%a"
- If you place this command into a batch file, code it like so:
for /d %%a in (vms2001*.*) do rd /s /q "%%a"
 
F

Flavius Vespasianus

- Start a Command Prompt.
- Naviage to the parent directory of the problem directory.
- Type this command: dir vms2001*.*
- Convince yourself that nothing other than the problem
directory answers to this wildcard description.
- Type this command:
for /d %a in (vms2001*.*) do rd /s /q "%a"
- If you place this command into a batch file, code it like so:
for /d %%a in (vms2001*.*) do rd /s /q "%%a"

Unfortunately, this does not work either. Prints out the name of the file
but give the error message "The system cannot find the file specified."

IN other word the "in (vms2001*)" finds the file but RD won't delete it.
 
P

Pegasus \(MVP\)

Flavius Vespasianus said:
Unfortunately, this does not work either. Prints out the name of the file
but give the error message "The system cannot find the file specified."

IN other word the "in (vms2001*)" finds the file but RD won't delete it.

Did you include the double quotes in my suggested command?
for /d %a in (vms2001*.*) do rd /s /q "%a"

Here is another way to delete recalcitrant files or folders:
for /d %a in ("c:\Some Folder\Some Subfolder\vms2001*.*) do echo rd /s /q
"\\.\%a"

Remove the "echo" keyword to make the command line effective.

If this does not work then perhaps Safe Mode or Recovery
Console will work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top