Show the contents of the Recycle Bin folder

Show the contents of the Recycle Bin folder

You can use the ShellExecute API function to programmatically open a window of Explorer and display the contents of the Recycle Bin. This is the function’s declare:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _    ByVal lpParameters As String, ByVal lpDirectory As String, _    ByVal nShowCmd As Long) As Long

The first parameter is the handle of parent window, the second is the action to be peerformed (in our case is “open”), the third argument is the application to execute, the fourth is the command line for the application, the fifth is the default directory. The last specifies the style of the window (maximized, normal or minimized), and you can use the same constants accepted by VB’s Shell function. As you see in the following code, the trick is to specify the special GUID of the Recicly Bin in the command string passed to Explorer:

Private Sub cmdShowRecycleBin_Click()    ShellExecute 0, "Open", "explorer.exe", _        "/root,::{645FF040-5081-101B-9F08-00AA002F954E}", 0&, vbNormalFocusEnd Sub

The user can then select the Empty Recycle Bin command from the File menu to manually empty the Recycle Bin, if desired.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several