This question is a means of preventing automated form submissions by spambots.
What are the l a s t four characters of "ab847ae805dc98184168c1a"? You must also add "xx!1.." to the answer but type "1" as a word not a number.
Smilies
:clap: :crazy: :thumbdown: :thumbup: :wtf: :yawn: :tired: :relaxed: :grin: :smile: :wink: :sad: :eek: :shock: :???: :cool: :lol: :mad: :razz: :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :neutral: :mrgreen: :geek: :ugeek: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :wave:
   

If you wish to attach one or more files enter the details below.

!, 2020-06-18 12:49 »

Oh, very cool addendum, thank you. :clap:

Steven W, 2020-06-18 04:32 »

Of course, that's a nuke it all.

Steven W, 2020-06-18 04:27 »

for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)

:wink:

How to delete everything including folders in a directory with a batch file

!, 2015-12-19 10:12 »

How to delete and remove everything recursively including folders in a directory (or several directories with a list of them inside an array) with a batch file.

Like this:

Code: Select all

@echo off

setlocal enabledelayedexpansion

set _folderstoclean[1]="c:myfoldera*"
set _folderstoclean[2]="c:myfolderb*"
set _folderstoclean[3]="c:myfolderc*"

for /l %%i in (1,1,3) do (
   del /q !_folderstoclean[%%i]!
   for /d %%x in (!_folderstoclean[%%i]!) do rd /s /q ^"%%x^"
)

This line:

Code: Select all

for /l %%i in (1,1,3) do (

"3" is the number of your folders in your array, in this case, we got 3 folders to clean:

Code: Select all

set _folderstoclean[1]="c:myfoldera*"
set _folderstoclean[2]="c:myfolderb*"
set _folderstoclean[3]="c:myfolderc*"

So if you had a fourth folder, you would add another line:

Code: Select all

set _folderstoclean[4]="c:myfoldera*"

...and change the 3 to 4:

Code: Select all

for /l %%i in (1,1,4) do (

Etc.

Top