fso.deletefile problem

chris-uk-lad

Registered User.
Local time
Today, 13:57
Joined
Jul 8, 2008
Messages
271
Hi,

When i run a piece of code to run through subfolders finding files that arent named after the subfolder, and delete them, i hit a problem. An error says 'permission denied' when it hits this line, BUT if i then open the file, close it, then run again, it will delete it :x

Code:
For Each f1 In f
If f1 <> subF1.Path & "\" & subF1.Name & ".tif" Then
fso.DeleteFile f1
End If

Any tips?
 
here is my 2 cents worth (because i don't know the answer):

RESTART YOUR COMPUTER.
 
And when thats not the reason it wont delete??

(yes i tried >.>)
 
i know this isnt a straight answer, but instead of using file scriptiing, try the intrinsic

dir and kill commands to do the same thing
 
I have to agree. I never use the object based file thingy 'cause the old stuff works great for me.

And Vista seems to have some problems that I can reproduce that I cannot reproduce in older OSs. Mine can't be corrupt since it is a brand new computer with a Dell factory installed OS. The search command in Vista DOES NOT WORK.
 
The search command in Vista DOES NOT WORK.
LOL! :p How do you like that IMPROVED automation there George????? he he... It sucks, doesn't it? :rolleyes: Also, have you noticed the IMPROVED technology that they've created on websites now, where you can click the textbox for attachments and it automatically pops up the dialog for file picking? There will be no more browse buttons in the near future.

As a HUGE side note to this thread, does anyone know how long it will be before text messaging while driving is banned in all 50 states?
 

Users who are viewing this thread

Back
Top Bottom