Sub cmdDelete() Dim myFileSystemObject As FileSystemObject Set myFileSystemObject = New FileSystemObject myFileSystemObject.DeleteFolder "c:\yourFolder" myFileSystemObject.DeleteFile "c:\yourFile" Set myFileSystemObject = Nothing End Sub