Batch remove old profiles -


I need a script to remove Windows XP profiles older than 1 year (without delprof.exe) I first To remove all temporary files in CCleaner used windows and user profiles.

  start / wait ccleaner.exe / auto  

Then I want to delete the profile. But just RMDir will not work

It should do this:

  @OKO close & amp; "DT = %% A" set "YYYY =% dt: ~ 0,4%" & amp; Set to setlocal / f "tokens = 2 delims ==" %% (get 'wmic OS local data time / value') set "mm =% dt: ~ 4,2%" & amp; Set the "DD =% dt: ~ 6,2%" set / a YYYyprev =% YYYY% -1 wmic path win32_userprofile "like local path '% Admin%' and special = false and loaded = false and last best time & Lt; '% YYYYPrev %% MM %% DD%' "Delete  

Comments