1.

Solve : batch to delete directory and subfolder files?

Answer»

Dear all,

Can you please help me in creating a batch file, to delete directory and subfolder files.


Thank you,
puli,
Sys adminHave you had a look at the help ?
Type help at the command promptQuote from: puli.sysadmin on January 25, 2010, 03:47:29 AM

"Can you please help me in creating a batch file,
to delete directory and subfolder files."


C:\batch>type deldir.bat

Code: [Select]@ECHO off

md puli
cd puli

md subpuli

echo puli in subpuli > puli.txt
dir
type puli.txt

cd \
cd batch

echo.

echo REMOVE directory and subpuli

echo.

rd /s puli

echo.
Output:

C:\batch>deldir.bat
Volume in drive C has no label.
Volume SERIAL Number is F4A3-D6B3

Directory of C:\batch\puli

01/25/2010 01:04 PM .
01/25/2010 01:04 PM ..
01/25/2010 01:04 PM 19 puli.txt
01/25/2010 01:04 PM subpuli
1 File(s) 19 bytes
3 Dir(s) 303,027,625,984 bytes free
puli in subpuli

remove directory and subpuli

puli, Are you sure (Y/N)? y


C:\batch>dir puli
Volume in drive C has no label.
Volume Serial Number is F4A3-D6B3

Directory of C:\batch

File Not Found

C:\batch>Thanks friend, for your inputs... the batch file is working fine.


Thank you so much.U cud also use this
Code: [Select]rd /S /Q NAMEOFTHEFOLDER


Discussion

No Comment Found