does the 'kill' cmmand work for both files and folders??
Kill "C:\test.txt"
Kill "C:\folder1"
so the 2nd one would remove the folder1 alltogether?
Printable View
does the 'kill' cmmand work for both files and folders??
Kill "C:\test.txt"
Kill "C:\folder1"
so the 2nd one would remove the folder1 alltogether?
Yes, but that won't send it to the recycle bin. If you want to then do this
VB Code:
Private Type SHFILEOPTSTRUCT hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As Long End Type Private Declare Function SHFileOperation Lib "shell32.dll" _ Alias "SHFileOperationA" (lpFileOp As SHFILEOPTSTRUCT) As Long Private Const FO_DELETE = &H3 Private Const FOF_ALLOWUNDO = &H40 Private Sub cmdDel_Click() DeleteFileToRecycleBin (Desired Location) End Sub Public Sub DeleteFileToRecycleBin(Filename As String) Dim fop As SHFILEOPTSTRUCT With fop .wFunc = FO_DELETE .pFrom = Filename .fFlags = FOF_ALLOWUNDO End With SHFileOperation fop End Sub
but also is:
Kill ("C:\MyTrashFiles")
same as..
Kill ("C:\MYTRASHFILES")
?