Why are you using WMI for this? It would be much easier to use the FileSystemObject:
'**************Start******
strComputer = "."
Set objFSO = CreateObject("Scripting.Fi
Set colFiles = objFSO.GetFolder("\POP_Out
If colFiles.Count >1 Then
Context.SetResult 1, "Too many Files. Please Check "
End If
'******Finish***********
Main Topics
Browse All Topics





by: vsg375Posted on 2007-08-23 at 10:36:39ID: 19756251
Hi,
I see nothing wrong in that script... I'd check what actual number is returned :
If colFiles.Count >1 Then
wscript.echo colFiles.Count
End If
If the result is 0 or 1 in a non empty folder, there's another problem.
Please let me know.
HTH
Cheers