youtuber Posted February 14, 2020 Share Posted February 14, 2020 How can I delete user recent files? None of the following commands work. #RequireAdmin FileDelete(@UserProfileDir & "\Recent\New AutoIt v3 Script.au3") FileDelete("C:\Users\USER\Recent\*.*") FileRecycle(@UserProfileDir & "\Recent\*.*") FileRecycle(@HomeDrive & @HomePath & "\Recent\*.*") Link to comment Share on other sites More sharing options...
Nine Posted February 14, 2020 Share Posted February 14, 2020 #include <File.au3> $array = _FileListToArray (@UserProfileDir & "\AppData\Roaming\Microsoft\Windows\Recent") _ArrayDisplay ($array) youtuber 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
youtuber Posted February 14, 2020 Author Share Posted February 14, 2020 (edited) @Nine Thanks I distracted, I even researched, I never thought she was in that position. Edited February 14, 2020 by youtuber Link to comment Share on other sites More sharing options...
Neutro Posted February 15, 2020 Share Posted February 15, 2020 (edited) You also need to check attributes of these files before deleting them, as stated in the Filedelete function help file: Quote Some file attributes can make the deletion impossible, if this is the case look at FileSetAttrib() to change the attributes of a file. You can also use the del command from windows as an alternative: ;this function will delete everything inside a folder, without deleting the folder itself func deletefoldercontent ($path) RunWait(@ComSpec & " /c " & 'del /s /f /q "' & $path & "*.*" & '"', "", @SW_HIDE) ;delete all files in the directory and sub directories RunWait(@ComSpec & " /c " & 'del /s /f /q "' & $path & "*.*" & '" /A:H', "", @SW_HIDE) ;delete all hidden files in the directory and sub directories RunWait(@ComSpec & " /c " & 'for /f "delims=?" %f in (''dir /ad /b ' & '"' & $path & '"' & ''') do rd /s /q "' & $path & '%f"', "", @SW_HIDE) ;list all subfolders and delete them EndFunc deletefoldercontent(@UserProfileDir & "\Recent\) Edited February 15, 2020 by Neutro youtuber 1 Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now