'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)<br>
'If the user windows 'delete to recycle bin' option is disabled, the file will deleted completely.<br>
'Insert this code to the module :<br>
<br>
Public Type SHFILEOPSTRUCT<br>
hwnd As Long<br>
wFunc As Long<br>
pFrom As String<br>
pTo As String<br>
fFlags As Integer<br>
fAnyOperationsAborted As Boolean<br>
hNameMappings As Long<br>
lpszProgressTitle As String<br>
End Type<br>
Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" _<br>
(lpFileOp As SHFILEOPSTRUCT) As Long<br>
Public Const F0_DELETE = &H3<br>
Public Const F0F_ALLOWUNDO = &H40<br>
Public Const F0F_CREATEPROGRESSDLG As Long = &H0<br>
<br>
'Insert the following code to your form:<br>
<br>
Private Sub Form_Load()<br>
Dim MyBool As Boolean<br>
'Replace 'c:\MyDir\MyFile.exe' with the name of the file you want to delete.<br>
DelToRecycBin ("c:\MyDir\MyFile.exe"

<br>
End Sub<br>
<br>
Public Function DelToRecycBin(FileName As String)<br>
Dim FileOperation As SHFILEOPSTRUCT<br>
Dim lReturn As Long<br>
On Error GoTo DelToRecycBin_Err<br>
With FileOperation<br>
.wFunc = F0_DELETE<br>
.pFrom = FileName<br>
.fFlags = F0F_ALLOWUNDO + F0F_CREATEPROGRESSDLG<br>
End With<br>
lReturn = SHFileOperation(FileOperation)<br>
Exit Function<br>
DelToRecycBin_Err:<br>
MsgBox Err.Description<br>
End Function<br>
<br>
<p>Eric De Decker<br><a href=mailto:vbg.be@vbgroup.nl>vbg.be@vbgroup.nl</a><br><a href=
Basic Center</a><br>