TheFixer Posted March 25, 2016 Share Posted March 25, 2016 Hello reader, I would like to know if and/or how it is possible to check if recycle bin has files or folders in it. So my code would eventually be like this (if these were the commands) if fileshere then FileRecycleEmpty() ;empties recylce bin endif Link to comment Share on other sites More sharing options...
Dgameman1 Posted March 25, 2016 Share Posted March 25, 2016 Why does it matter if files are there or not? Just run FileRecycleEmpty() And if there's an error that means that there's nothing to empty. Right? Link to comment Share on other sites More sharing options...
Dgameman1 Posted March 25, 2016 Share Posted March 25, 2016 Global $SHQUERYRBINFO = DllStructCreate("align 1;int;int64;int64") ; v3.2.11.3 DllStructSetData($SHQUERYRBINFO, 1, DllStructGetSize($SHQUERYRBINFO)) $Query = DllCall("shell32.dll", "int", "SHQueryRecycleBin", "str", "C:\", "ptr", DllStructGetPtr($SHQUERYRBINFO)) If DllStructGetData($SHQUERYRBINFO, 3) <> 0 Then FileRecycleEmpty() EndIf Here's the code by the way TheFixer 1 Link to comment Share on other sites More sharing options...
TheFixer Posted March 25, 2016 Author Share Posted March 25, 2016 5 minutes ago, Dgameman1 said: Global $SHQUERYRBINFO = DllStructCreate("align 1;int;int64;int64") ; v3.2.11.3 DllStructSetData($SHQUERYRBINFO, 1, DllStructGetSize($SHQUERYRBINFO)) $Query = DllCall("shell32.dll", "int", "SHQueryRecycleBin", "str", "C:\", "ptr", DllStructGetPtr($SHQUERYRBINFO)) If DllStructGetData($SHQUERYRBINFO, 3) <> 0 Then FileRecycleEmpty() EndIf Here's the code by the way Thank you Link to comment Share on other sites More sharing options...
AdamUL Posted March 25, 2016 Share Posted March 25, 2016 There is a UDF already included with AutoIt that has this DLL call. _WinAPI_ShellQueryRecycleBin() Adam 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