I have a structure like this:
C:\Users\UT45\AppData\Logs\
C:\Users\CR45\AppData\Logs\
C:\Users\UT45\AppData\Logs\
I need to delete all the file and folder under Logs folder, but only for the user which username starts with: UT*
This command works for all the file, but not for the folder:
Code: Select all
for /D %%I in ("C:\Users\UT*") do del /A /F /Q "%%I\AppData\Logs\*" 2>nul
Thank you to all, have a nice day!