Can't get a directory to delete from command prompt

C

COC

I run Windows 2000 Server Professional. Over a year ago,
I needed to do a restore of system files due to a virus.
I inadvertantly started to restore the system files to a
new directory (created during the restore). The original
restore was aborted and a subsequent restore was
successful to the root drive, and the system works fine.

Now when I try to delete the unwanted directory, it says
that some of the files in it may be in use, and won't let
me. (To the best of my knowledge, the directory is empty,
unless there is a hidden file in there. But in the view
of the directory, I set it to show all files hidden or
not, and none show up.) So I booted into a safe mode and
tried again. Same thing, would not let me delete it. So
I booted into a command prompt mode. (Not sure this is
really a DOS mode or not, a true DOS mode option was not
given in the boot process.) So now, when I try to delete
the directory from a command line, it says that I have a
bad syntax.

The name of the directory is:

p:\Restore 1-10-2003

Exactly that, with the spaces, dashes, etc.

So I try to delete the directory as follows:

p:\rd Restore 1-10-2003, also tried p:\rmdir Restore 1-10-
2003, and finally tried p:\deltree Restore 1-10-2003

But then it comes up with the syntax error each time, or
can't find specified file. I can path to the directory
and open it, and it shows nothing inside, so DOS does
recognize it with certain commands.

Any ideas how I can delete this directory?

Thanks
 
P

Phil Robyn [MVP]

COC said:
I run Windows 2000 Server Professional. Over a year ago,
I needed to do a restore of system files due to a virus.
I inadvertantly started to restore the system files to a
new directory (created during the restore). The original
restore was aborted and a subsequent restore was
successful to the root drive, and the system works fine.

Now when I try to delete the unwanted directory, it says
that some of the files in it may be in use, and won't let
me. (To the best of my knowledge, the directory is empty,
unless there is a hidden file in there. But in the view
of the directory, I set it to show all files hidden or
not, and none show up.) So I booted into a safe mode and
tried again. Same thing, would not let me delete it. So
I booted into a command prompt mode. (Not sure this is
really a DOS mode or not, a true DOS mode option was not
given in the boot process.) So now, when I try to delete
the directory from a command line, it says that I have a
bad syntax.

The name of the directory is:

p:\Restore 1-10-2003

Exactly that, with the spaces, dashes, etc.

So I try to delete the directory as follows:

p:\rd Restore 1-10-2003, also tried p:\rmdir Restore 1-10-
2003, and finally tried p:\deltree Restore 1-10-2003

But then it comes up with the syntax error each time, or
can't find specified file. I can path to the directory
and open it, and it shows nothing inside, so DOS does
recognize it with certain commands.

Any ideas how I can delete this directory?

Thanks

rd "p:\Restore 1-10-2003"
 
J

John N

Hi

Thanks for your suggestion. I tried your solution and
found a deeper problem. There is a hidden directory as
this:

P:\Restore 1-10-2003\system volume information\

I can path to it, but it won't let me in, "access
denied". There must be some files in there that the
system think are in use or something.

I can't access this sub directory from a safe mode either.

I researched and found the MoveFileEx command, but cannot
seem to come up with the exact syntax for the command to
work. I think I need to delete the files from the "system
volume information" directory first, and then the
directory according to the literature on it. But at this
point, I don't know if there might even be more sub
directories too.

If you could give me the exact syntax based upon the
information given, that would be great!

Or, any further help of any kind would be appreciated.

Thanks,

John
 
P

Paul R. Sadowski

John N said:
Hi

Thanks for your suggestion. I tried your solution and
found a deeper problem. There is a hidden directory as
this:

P:\Restore 1-10-2003\system volume information\

What I wonder is whether that is the current sys vol for the drive. Perhaps
you moved it there. Is there an P:\system volume information\
also (also hidden)?
 
G

Gary Smith

John N said:
There is a hidden directory as this:

P:\Restore 1-10-2003\system volume information\

I can path to it, but it won't let me in, "access
denied". There must be some files in there that the
system think are in use or something.

I can't access this sub directory from a safe mode either.

This is restored copy of a system-managed folder that Windows uses for
its own mysterious purposes. Normally there's one such folder in the
root of each NTFS partition. By default you can't so anything with it
because access is granted only to the built-in system account.

To get around that, right-click on the folder, click Properties, Security
tab, Advanced button, Permissions tab. Click the Add button and add the
Everyone group, giving it Full Control. (If we were just looking, we'd be
more restrictive about permissions, but since the object is to delete the
folder, it doesn't matter.) You should now be able to view and delete the
folder and its contents.

When you delete a folder from a command prompt, put the folder name in
quotes if it contains spaces or other delimiters. Once the permissions
problem is resolved, this should flush everything:

RD /s "P:\Restore 1-10-2003"
 
G

Guest

Gary:

Thanks for your suggestion. It worked! I did however,
check to see that the "system volume information" folder
in the Restore 1-10-2003 directory was in fact a
duplicate. I could find a "System Volume Information"
folder in the root (e.g. c: & P: of my computer) so I knew
that this one was a duplicate, and not the original or
current one which was being used.

I really appreciate your help.

John
 
J

John N.

Thanks for your suggestion in checking to make sure that
the "system volume information" folder was in fact not the
current one. It was not. I could find the current SVI
file in the root of C: and P:, so I knew that this one was
a duplicate.

Gary Smiths suggestion in the thread above worked. We
gave the parent file full administrative rights, and I was
then able to delete it with no problem.

I rebooted the system and have been using both the C: and
P: drives, and everything still seems to be working.

Thanks again for your suggestion.

John N.
 
G

Gary Smith

Thanks for the feedback. I'm glad I could help.

Thanks for your suggestion. It worked! I did however,
check to see that the "system volume information" folder
in the Restore 1-10-2003 directory was in fact a
duplicate. I could find a "System Volume Information"
folder in the root (e.g. c: & P: of my computer) so I knew
that this one was a duplicate, and not the original or
current one which was being used.
 

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