how to delete all folders created by user?

January 31, 2011 at 22:35:34
Specs: Windows XP
I want to delete all folders (only folders) created by a user on desktop when the user logoff. How can i do this. Would anyone help me??? Waiting for reply.......thanks in adv

See More: how to delete all folders created by user?

Report •

#1
February 1, 2011 at 08:27:19
I think this will work...

for /f "tokens=*" %%a in ('dir "%userprofile%\desktop" /b /ad') do (del "%%a")

but this is off the top of my head and untested. You may just want to do this...

for /f "tokens=*" %%a in ('dir "%userprofile%\desktop" /b /ad') do (
echo del "%%a"
pause)

Just to make sure the command is formatted right before you remove the echo and pause.


Report •
Related Solutions


Ask Question