I am trying to loop through all the files and folder of specified directories and then delete them. I have very no previous experience with batch scripts and I have done quite a bit of online research, however I can't figure out why the following doesn't work:
@echo off
CLS
mode con: cols=160 lines=60
echo.
::****************************************************************
Set Location[0]=\lib\Debug
Set Location[1]=\temp\
::****************************************************************
:BEGIN
echo start
for /F "tokens=2 delims==" %%s in ('set Location[') do (
for /r %%i in (%%s) do echo %%i
)
echo end
pause
What ends up happening is it lists all the files in the current directory of the batch script.
How do I make this script loop through all the directories specified in the Location variable and then delete all files and folders it finds in there. Clean Slate.