• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 641
  • Last Modified:

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
  • 2
1 Solution
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.

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


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"
	sData = "Bad Request"
End If
MsgBox sData

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now