Usage:
Dim Action As New ShellActions
Action.EmptyRecycleBin()
Public Class ShellActions
Shared Function _
SHEmptyRecycleBin(ByVal hWnd As Integer, ByVal pszRootPath As String, _
ByVal dwFlags As Integer) As Integer
End Function
Sub New()
EmptyRecycleBin()
End Sub
Sub EmptyRecycleBin(Optional ByVal rootPath As String = "", _
Optional ByVal noConfirmation As Boolean = True, Optional ByVal NoProgress _
As Boolean = True, Optional ByVal NoSound As Boolean = True)
Const SHERB_NOCONFIRMATION = &H1
Const SHERB_NOPROGRESSUI = &H2
Const SHERB_NOSOUND = &H4
If rootPath.Length > 0 AndAlso rootPath.Substring(1, 2) <> ":\" Then
rootPath = rootPath.Substring(0, 1) & ":\"
End If
Dim flags As Integer = (noConfirmation And SHERB_NOCONFIRMATION) Or _
(NoProgress And SHERB_NOPROGRESSUI) Or (NoSound And SHERB_NOSOUND)
SHEmptyRecycleBin(0, rootPath, flags)
End Sub
How to empty a recycle bin
VB.NET forum discussion
-
ICSharp ZIP library C# to VB.NET Port
by Garry Wang (6 replies)
-
Printing with formatting in VB.NET
by jclebon (7 replies)
-
IP2Location Geolocation .NET Component in VB.NET
by dunking (5 replies)
-
Watching Folder Activity in VB.NET
by emmaddai (17 replies)
-
print a document file without using print dialog control in Vb.net
by konikula (1 replies)
VB.NET podcasts
-
.NET Rocks: Eric Lippert Talks About Project Roslyn
Published 9 years ago, running time 0h56m
Recorded on PI day, Carl and Richard talk to the one-and-only Eric Lippert from the C# Compiler team. But we don't only talk about C#! The conversation wanders around all the languages, a little F#, a little IronPython, heck, even VB.NET! Eric talks about Project Roslyn, Microsoft's efforts to ma.
Comments