Script to check if the machine has a valid carepack from HP website

Anyone ?
Script to check if the machine has a valid carepack from HP website.
I have found the other script here on http://www.experts-exchange.com  but that one don´t check if customer buys extra carepack
gasystemAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ChizlCommented:
Do you mean does someone have a VBS that scrapes HP's website or are you asking if HP's site has carepack displayed somewhere?
gasystemAuthor Commented:

Same as this script http://www.experts-exchange.com/Programming/Languages/Q_23097377.html?sfQueryTermInfo=1+check+hp+warranti  this script checks only standard warranty not status of care pack.


ChizlCommented:
Well based on the HTML data the URL you would hit is:

http://www11.itrc.hp.com/service/ewarranty/warrantyResults.do?BODServiceID=NA&RegisteredPurchaseDate=&country=US&productNumber=123456&serialNumber1=123&serialNumber2=456

Changing the above product number to your own and each of the serial numbers to your own as well.   Since no one here would have valid numbers to put in there, it's hard for us to post any code that scrapes the site and gives you the information your looking for.    However, to pull the page data just hit the URL above with the below code to pull what the page looks like.   From there you would just use Instr() to find the data in the text your looking for the Mid() them out so you can do what you want with them.    I wouldn't ever use the Internet Explorer object do get data..   Use MSXML it's faster and cleaner to view.   Below is an example.
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
 
'set timeout for 3 seconds for each type.
'Resolve, Connect, Send, Receive
'xmlhttp.setTimeouts 3000, 3000, 3000, 3000   'Uncomment to use
 
sURL = 				"http://www11.itrc.hp.com/service/ewarranty/warrantyResults.do?BODServiceID=NA&RegisteredPurchaseDate="
sURL = sURL & "&country=US"
sURL = sURL & "&productNumber=123456"
sURL = sURL & "&serialNumber1=4567989"
sURL = sURL & "&serialNumber2=4567989"
 
xmlhttp.open "GET", sURL, false
xmlhttp.send ""
 
iStatus = xmlhttp.Status
 
If iStatus = 200 Then
	sData = xmlhttp.responseText
ElseIf iStatus = 404 Then
	sData = "File Not Found"
Else
	sData = "Bad Request"
End If
 
MsgBox sData

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.