by
0
7
4,478
0
Top 1% !
Popular
Famous
Tagged
Easy-to-find
Specified
OpenSource
Popularity: 2200th place

Published on:

Architecturex86_64
LanguageDOS Shell
LicenseMIT_X11
OSWindows

How to find and remove directories in windows batch command

The script will search for a given path and returns the name of folders found.

The script may remove the directory found (with or without prompt)
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/11370/How-to-find-and-remove-directories-in-wi?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
@echo off set m_path="C:\Users" if exist %m_path% ( cd %m_path% echo FOUND %m_path% REM pippo for /F %%i in ('dir obj /s /b') do ( echo "dir %%i" REM Remove dir without prompt rmdir %%i /s /q REM Remove dir with prompt REM rmdir %%i /s ) ) pause
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus