Try this in a .BAS module:<br>
<br>
Option Explicit<br>
<br>
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 Long<br>
hNameMappings As Long<br>
lpszProgressTitle As String ' only used if FOF_SIMPLEPROGRESS<br>
End Type<br>
<br>
Public Const FO_DELETE = &H3<br>
Public Const FOF_ALLOWUNDO = &H40<br>
<br>
Declare Function SHFileOperation _<br>
Lib "shell32.dll" _<br>
Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long<br>
<br>
Public Function ShellDelete(FileName As String)<br>
Dim I As Integer<br>
Dim sFileNames As String<br>
Dim SHFileOp As SHFILEOPSTRUCT<br>
<br>
sFileNames = FileName & vbNullChar<br>
With SHFileOp<br>
.wFunc = FO_DELETE<br>
.pFrom = sFileNames<br>
.fFlags = FOF_ALLOWUNDO<br>
End With<br>
<br>
ShellDelete = SHFileOperation(SHFileOp)<br>
End Function<br>
<br>
Of course, this code has a dependence on the Windows 95-style shell, so it won't work on any version of NT prior to 4.0. I think Microsoft said that this might have changed under Windows 2000, but I don't know for sure.<br>
<br>
You can also string together a series of files to be deleted, by separating them with vbNullChar's.<br>
<br>
Chip H.<br>