I'm trying to use the vbs script to curl an url then get the script errorlevel. but always got 6 returned.
this can get the right errorlevel
C:\Users\lo>curl -Iks https://www.baidu.com | findstr /i 200
HTTP/1.1 200 OK
C:\Users\lo>echo %errorlevel%
0
C:\Users\lo>curl -Iks https://www.baidu.com | findstr /i hahaha
C:\Users\lo>echo %errorlevel%
1
below is vbs script
Set shell = CreateObject("WScript.Shell")
rc1 = shell.run("curl -Iks https://www.baidu.com | find /i 200", 0, true)
WScript.echo(rc1)
rc2 = shell.run("curl -Iks https://www.baidu.com | find /i hahaha", 0, true)
WScript.echo(rc2)
BR//lo