> thx for your help
>
> maybee i didnt made my self clear - i want to put this into a VB Script.
> The code im using is:
>
> set objfs = CreateObject("Scripting.FileSystemObject")
> strFileName = SPEICHERORTBackup & "KW " & KW1 & "*" & BKFName & "*Tag "
> & WochentagZahl & "*(differential)*.bkf"
> objfs.DeleteFile strFileName
>
> Now the script stops if the files isnt there ... this error i want to fix
>
> reg
> Max
>
> "Jeffery Hicks" <jhicks[ at ]sapien.com> schrieb im Newsbeitrag
> news:uyr$mqGnHHA.3736[ at ]TK2MSFTNGP03.phx.gbl...
>> Max Meier wrote:
>>> Hello Groupies,
>>>
>>> i would like to find files an delete them, if they exists. the syntax
>>> for the files is FILE*.txt.
>>> if i try to use the if exists syntax i get the error message, that
>>> the file does not exists. i think its because of the *
>>>
>>> maybee i can solve the problem, when i count all files FILE*.txt and
>>> if its more then 0, i delete FILE*.txt
>>>
>>> Can someone tell me how i can count the files?? or is there a better
>>> way to do this?
>>>
>>> reg. Max
>>
>> If you want to use a batch file, change to the directory and run a
>> command like this:
>>
>> for /f %x in ('dir file*.txt /b') do [ at ]del %x
>>
>> I recommend you run this first so you can see what files would be
>> deleted:
>>
>> for /f %x in ('dir file*.txt /b') do [ at ]echo %x
>>
>> The other way you could do this would be to use the FileSystemObject
>> in VBScript.
>>
>> --
>> Jeffery Hicks
>> SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
>> VBScript & Windows PowerShell Training -
>> www.ScriptingTraining.com/classes.asp
>> Windows PowerShell? - www.SAPIENPress.com/powershell.asp
>>
>> blog:
http://blog.SAPIEN.com>> blog:
http://jdhitsolutions.blogspot.com>>
>
What about something like this: