Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a batch file that copy all the files from src place to dest place.

I used xcopy command.

Now I want to make sure all of my file copy correctly and delete all the files in src folder, do you have any idea?

I dont know is there any command for delete the folder with all the files and folder inside it?

please advise me....

my source folder has below structure

> root | 
>         [sub folder1]
>         |
>         filex.s
>         filei.z 
>         [sub folder2]
>         |
>         filep.a
>         fileq.q
>         [sub folder3]
>         |
>         filex.s
>         filei.z
>         filsi.w 
> file1.xx 
share|improve this question
You could consider using the MOVE command instead of XCOPY – adam Jan 12 '11 at 5:09
xcopy much more reliable... – rima Jan 13 '11 at 11:17
up vote 1 down vote accepted

del /s would delete from subdirectories. fc would compare two files.

dir/s/b /a-d > list.bat would dump all file names to a text file.

You could use Notepad++'s Macros to mass edit the text file to FC each file.

You could use a batch file to do a sort of for/each over the files doing the same thing.

share|improve this answer
del /s do not delete the folders for folders what should I do? del just delete all files, I want remove folder also...for comparison do u have any code? – rima Jan 12 '11 at 6:04
RD /s /q is much more better :) – rima Jan 12 '11 at 6:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.