Kill all text files except those starting with ~$



I am trying to write some code that when I exit my application kills all of
the text files in a certain folder. It is possible that some of those files
are locked because someone else is using them, in which case they will have
the first two letters of their name replaced with ~$. How can I write a
routine that will delete all the normal *.txt files, but not attempt to
delete the ~$ ones, which brings up an error message and prevents the
program from closing. I thought this would be easy, but I have not managed
to do it after quite a while trying.

dixie


.



Relevant Pages

  • Re: Kill all text files except those starting with ~$
    ... > I am trying to write some code that when I exit my application ... > kills all of the text files in a certain folder. ...
    (comp.databases.ms-access)
  • Re: Word 97
    ... I exit out of the "save as" and then have my new folder. ... >I am at my wits end. ... Prev by Date: ...
    (sci.med.transcription)
  • Re: FolderBrowserDialog hangs the application
    ... When I hit the ... One EXIT and one FBD. ... The FBD button does a FolderBrowserDialog and nothing else. ... > I don't even have to pick a folder for this to happen). ...
    (microsoft.public.dotnet.languages.vb)
  • Re: GPO Revent Saving to Desktop ??
    ... Don't Save Settings on Exit: Does not prevent users from adding Programs ... Shortcuts to Desktop ... You can lock the user into their My Documents folder as the ...
    (microsoft.public.win2000.general)
  • Re: vbscript to traverse subfolders
    ... FindFile = True ' return True when found ... ' I believe it puts a log entry for every folder searched ... if FindFile then exit next ' ensure exit from recursion ...
    (microsoft.public.scripting.vbscript)