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

Posted on 2008-11-06
Medium Priority
Last Modified: 2012-05-05
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
Question by:gasystem
  • 2

Expert Comment

ID: 22900536
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?

Author Comment

ID: 22902086

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.


Accepted Solution

Chizl earned 1000 total points
ID: 22905998
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


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question