|
-
Jan 14th, 2006, 11:25 PM
#1
Thread Starter
Addicted Member
Problem Deleting Folder. PLEASE HELP
Hey. I'm having the most trouble ever trying to delete a folder. Here's what I have for code:
If (IO.File.Exists("C:\Documents and Settings\" & Environment.UserName & "\Local Settings\Temp\program\Updater.exe")) = True Then
IO.File.Delete("C:\Documents and Settings\" & Environment.UserName & "\Local Settings\Temp\program\Updater.exe")
End If
If (IO.Directory.Exists("C:\Documents and Settings\" & Environment.UserName & "\Local Settings\Temp\Updater\") = True) Then
IO.Directory.Delete("C:\Documents and Settings\" & Environment.UserName & "\Local Settings\Temp\updater\")
End If
The first part deletes the file within the folder. Then the second part deletes the folder itself. It deletes teh file ok, but whenever it gets to the folder it says its in use! If i click continue and continue with using the program, i can IMMEDIATELY delete the folder-- as if its not in use! Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|