Reputation: 3
This is the code:
Private Sub DeleteFiles()
Dim file As String
Dim prefetchPath As String
prefetchPath = Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine) & "\Prefetch"
For Each file In IO.Directory.GetFiles(prefetchPath)
If file.Contains("EXAMPLE.EXE") Then
IO.File.Delete(file)
End If
Next
End Sub
If someone knows how to do the same thing with the cmd since the application doesn't delete the file if the application is open Thanks
Upvotes: 0
Views: 488
Reputation: 3758
There are two potential problems with that:
Upvotes: 2