Function Run_Cmd(strCmd)
Dim objShell
Dim objScriptExec
Dim strCmdResult
strCmd = "%comspec% /C " + strCmd
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.exec(strCmd)
set Run_Cmd = objScriptExec.StdOut
End Function
Function test ()
'...
Set objPropFilesList = Run_Cmd("dir /B " & sStarterDir & " | findstr /I """&test_list&"""")
if ( objPropFilesList.count = 0 ) Then
LogWrite "No EPM services found to verify... Aborting execution.", fAutoFixLog, bLogToConsole
wscript.echo "No EPM services found to verify... Aborting execution."
Exit Function
End If
Do Until objPropFilesList.AtEndOfStream
'...
Loop
End Function
In the above code,objPropFilesList returns text stream. When i have placed if condition to check the count, it skips the remaining code in this function. I doesn't understand why it skipping this code.
My suspection is that, as per below doc Count Property handles Dictionary object. The objPropFilesList returns the list of file names, does this will not be considered as dictionary object.
https://msdn.microsoft.com/en-us/library/ea5ht6ax(v=vs.84).aspx
I want to understand what exactly happening here.