Advertisement
Najeebsk

Del-Temp.ahk

Sep 25th, 2022
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;clears all (temp) files in the listed directories, except the one's which are in use
  2. ;C:\Users\Najeeb\AppData\Local\Temp
  3. dirs = %A_winDir%\Temp\*.*,%userprofile%\AppData\Local\Temp\*.*,C:\Temp\*.*,%userprofile%\Recent\*.*,%userprofile%\Cookies\*.txt,;%userprofile%\AppData\Local\Temporary Internet Files\*.* ;all code above is on ONE line
  4. Loop,parse,dirs,`,
  5. {
  6.    
  7. IfExist,%A_LoopField%
  8.    {
  9.    Loop,%A_LoopField%,1,1
  10.    FileSetAttrib,-H-S-R,%A_LoopField%,1,1
  11.    }
  12.    {
  13.    Loop,%A_LoopField%,1,1
  14.    FileRemoveDir,%A_LoopFileFullPath%,1
  15.    FileDelete,%A_LoopField%
  16.    }
  17. }
  18. FileRecycleEmpty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement