Hi.
I have the following script with which I check the file size and run a batch file depending on the size. My problem is that the file name will be different each time. There will be one file at a time in that folder. The script does not want to use the wildcard and states "Microsoft VBScript runtime error: File not found". Any ideas?
Dim fso
Dim fil
Dim shell1
Set fso = CreateObject("scripting.filesystemobject")
Set fil = fso.GetFile ("C:\Scripts\test\*.txt")
Set shell1 = createobject("wscript.shell")
If fil.Size > 0 Then
shell1.run "C:\Scripts\test\Copy.bat"
Else
shell1.run "C:\Scripts\test\move.bat"
End If
Best Regards, Morris Fury AFRIDATA.net