1.

Solve : Delete Folders And Files?

Answer»

Why So Serious EveryOne (Hello)   

I Want A Batch File To Copy Folder Structure And Add RD Command To It.. in a Text File

For Ex.

Folder Is

E:\Test

E:\Tmp

E:\....So And So


Then The Batch Should Be

Code: [Select]RD /F /Q Test
RD /F /Q Tmp
RD /F /Q So And So

Could ANYONE Pls Help Me 



Look at DIR /?, specifically, the B and S switches. Quote from: the_mad_joker on March 06, 2010, 03:07:36 AM

Folder Is

E:\Test

E:\Tmp

E:\....So And So


Then The Batch Should Be

Code: [Select]RD /F /Q Test
RD /F /Q Tmp
RD /F /Q So And So


C:\batch>TYPE   joker.bat
rem either cd to location or show complete path

Code: [Select]echo off

RD /s /Q E:\Test
RD /s /Q E:\Tmp
RD /s /Q E:\SoAndSo


rem C:\batch>rd  /?
rem emoves (deletes) a directory.

rem RMDIR [/S] [/Q] [drive:]path
rem D [/S] [/Q] [drive:]path

rem    /S      Removes all directories and files in the specified directory
rem             in addition to the directory itself.  Used to remove a directory

 rem            tree.

 rem    /Q      Quiet MODE, do not ask if ok to remove a directory tree with /S
Output:

C:\batch>joker.bat

C:\batch>rem either cd to location or show complete path
C:\batch>e:

E:\>cd tmp
The system cannot find the path specified.

E:\>cd test
The system cannot find the path specified.

E:\>cd soandso
The system cannot find the path specified.

E:\>


Discussion

No Comment Found