Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: I need to create a batch file, which should give me output and send emails  (Read 61279 times)

0 Members and 1 Guest are viewing this topic.

Hackoo



    Hopeful
  • Thanked: 42
  • Experience: Expert
  • OS: Windows 10
When i try like this :
Code: [Select]
:Check_URL
@for /F "usebackq delims=" %%u in ("%URL%") do (
curl -I -s "%%u" | find /I "200">nul 2>&1 && (
echo "%%u" ==^> is OK
) || (
echo ---------------------------------------------------
echo "%%u"
echo ---------------------------------------------------
curl -I -s "%%u"
)>>"%Not_OK_URL%"
)
I got something like that :
Code: [Select]
---------------------------------------------------
"http://dummy.restapiexample.com/api/v1/employee/1"
---------------------------------------------------
HTTP/1.1 400 Bad Request
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Type, X-Requested-With, X-authentication, X-client
Cache-Control: no-cache
Content-Type: application/json;charset=utf-8
Date: Tue, 21 Apr 2020 07:22:42 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Host-Header: c2hhcmVkLmJsdWVob3N0LmNvbQ==
Pragma: no-cache
Referrer-Policy:
Response: 400
Server: nginx/1.16.0
Set-Cookie: PHPSESSID=0fccc982efcf0603ff3db3828c95d3a6; path=/
Set-Cookie: ezoadgid_133674=-1; Path=/; Domain=restapiexample.com; Expires=Tue, 21 Apr 2020 07:52:41 UTC
Set-Cookie: ezoref_133674=; Path=/; Domain=restapiexample.com; Expires=Tue, 21 Apr 2020 09:22:41 UTC
Set-Cookie: ezoab_133674=mod62-c; Path=/; Domain=restapiexample.com; Expires=Tue, 21 Apr 2020 09:22:41 UTC
Set-Cookie: active_template::133674=pub_site.1587453761; Path=/; Domain=restapiexample.com; Expires=Thu, 23 Apr 2020 07:22:41 UTC
Vary: Accept-Encoding
Vary: Accept-Encoding,X-APP-JSON
X-Ezoic-Cdn: Miss
X-Middleton-Response: 400
X-Sol: pub_site

---------------------------------------------------
"http://dummy.restapiexample.com/api/v1/update/21"
---------------------------------------------------
HTTP/1.1 405 Method Not Allowed
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Type, X-Requested-With, X-authentication, X-client
Allow: PUT
Cache-Control: no-cache
Content-Type: text/html;charset=UTF-8
Date: Tue, 21 Apr 2020 07:22:44 GMT
Expires: Mon, 20 Apr 2020 07:22:44 GMT
Host-Header: c2hhcmVkLmJsdWVob3N0LmNvbQ==
Pagespeed: off
Pragma: no-cache
Referrer-Policy:
Response: 405
Server: nginx/1.16.0
Set-Cookie: PHPSESSID=c521f5c48c7cce039692a0b8452b2bf5; path=/
Set-Cookie: ezoadgid_133674=-1; Path=/; Domain=restapiexample.com; Expires=Tue, 21 Apr 2020 07:52:43 UTC
Set-Cookie: ezoref_133674=; Path=/; Domain=restapiexample.com; Expires=Tue, 21 Apr 2020 09:22:43 UTC
Set-Cookie: ezoab_133674=mod54-c; Path=/; Domain=restapiexample.com; Expires=Tue, 21 Apr 2020 09:22:43 UTC
Set-Cookie: active_template::133674=pub_site.1587453763; Path=/; Domain=restapiexample.com; Expires=Thu, 23 Apr 2020 07:22:43 UTC
Set-Cookie: ezCMPCCS=true; Path=/; Domain=restapiexample.com; Expires=Wed, 21 Apr 2021 07:22:44 GMT
Vary: Accept-Encoding
Vary: Accept-Encoding,X-APP-JSON
X-Ezoic-Cdn: Miss
X-Middleton-Response: 405
X-Sol: pub_site

---------------------------------------------------
"https://www.Vimeo.com"
---------------------------------------------------
HTTP/1.1 301 Moved Permanently
Connection: keep-alive
Content-Length: 226
Server: nginx
Content-Type: text/html; charset=iso-8859-1
Location: https://vimeo.com/
Expires: Mon, 15 Apr 2030 19:24:58 GMT
Via: 1.1 varnish
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
X-Varnish-Cache: 1
X-VServer: infra-webproxy-a-16
X-Vimeo-DC: ge
Via: 1.1 varnish
Accept-Ranges: bytes
Date: Tue, 21 Apr 2020 07:22:47 GMT
Via: 1.1 varnish
Age: 0
X-Served-By: cache-bwi5151-BWI, cache-cdg20749-CDG
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1587453767.126375,VS0,VE84
Vary: Accept-Encoding