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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sathya
Posts: 2
Joined: 27 Jan 2016 01:06

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

#1 Post by sathya » 27 Jan 2016 01:12

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

sathya
Posts: 2
Joined: 27 Jan 2016 01:06

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

#2 Post by sathya » 27 Jan 2016 23:08

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.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

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

#3 Post by ShadowThief » 28 Jan 2016 13:06

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.

Post Reply