Page 1 of 1

How to check the valid url and make a report for that url.

Posted: 27 Jan 2016 01:12
by sathya
Hi All,

I am new to the batch programming,i have three urls.like below.

www.example1.com
www.example2.com
www.example3.com

when i run the batch file it should check the url is valid or not without opening the browser and produce the report in command prompt as valid or invalid

www.example1.com valid ---->if url exists it should display as valid
www.example2.com invalid--->if url not exists it should display as invalid
www.example3.com valid---->if url exists it should display as valid


kindly help me to get the solution..

Thanks

Re: How to check the valid url and make a report for that url.

Posted: 27 Jan 2016 23:08
by sathya
Is it possible using the dos batch programming.can any one provide the simple code to help me pls..when you get time do the favour for me.

Re: How to check the valid url and make a report for that url.

Posted: 28 Jan 2016 13:06
by ShadowThief

Code: Select all

<nul set /p "=www.example1.com..."
(ping www.example1.com >nul&&echo Valid)||echo Invalid


And then repeat for the other URLs you want to check.