Helle there, I have question to make. You all know the kill command, I am testing it to gain experience on VB, because I am still a begginer. I opened a new form with just 2 objects, a text object (txtkilltarget) and a command button (cmdkill). So, the user enters a path and can kill a file with the command button. So far so good, all works fine but what if the target file is hidden? It doesn't find the file so it can't kill it. What can I do about it? Can I somehow make the file first visible, if hidden, and then kill it or even better let the cmdkill know that it is hidden so it finds it somehow and then kills it. Here is my code:
vb
Private Sub cmdkill_Click()
On Error GoTo NotFound
Kill txtkilltarget.Text
GoTo TheEnd
NotFound:
MsgBox "An error occured, check if file destination is correct."
TheEnd:
End Sub