I want to remove all directory in BAT FILE in this path but i don't understand why don't work.
for /d %f in ("C:\Users\Users\AppData\Roaming\Mozilla\Firefox\dir_temp_profile\*") do (
rmdir %f
)
Thank you for you help
I want to remove all directory in BAT FILE in this path but i don't understand why don't work.
for /d %f in ("C:\Users\Users\AppData\Roaming\Mozilla\Firefox\dir_temp_profile\*") do (
rmdir %f
)
Thank you for you help
I think first you need to remove all the files and then the folders.
This might help:
Just make sure you set your target_path
variable accordingly:
@echo off
set "target_path=C:\path\to\your\folder"
REM Remove files recursively
for /r "%target_path%" %%F in (*) do (
del "%%F" /q
)
REM Remove folders recursively (starting from deepest)
for /d /r "%target_path%" %%D in (*) do (
rmdir "%%D" /s /q
)
echo Removal complete.
Let me know if that helped.