Dell Warranty Information Script

By , June 17, 2010 4:00 pm

Important: Due to changes to Dell’s website, the script below no longer works. An updated script is available on this page.

Updated: 2/14/2012

This is a VBScript that I wrote a few months ago as an example of how to retrieve warranty information from the Dell website. The script writes warranty information to subkeys under HKLM\Software\DellWarrantyInfo in the registry.

Dell doesn’t provide a web service for querying warranty information (that I know of), so I had to scrape the HTML. That means this script may stop working properly if Dell makes changes to the layout of their warranty information page. I wish Dell provided a more reliable method for retrieving warranty information.

Update 1/3/2011: Thanks to Patrick for letting me know that dell added a new column to the warranty information table. I updated the script to reflect this.

'=====================================================================
'	Dell Warranty Grabber
'	Author: 	Matthew Boyd (iboyd.net)
'	Date:		3/25/2010
'
'	This is  an example of how to query the Dell website for
'	Warranty Information and parse the HTML source.
'	values are then written to the registry of the local
'	computer.
'
'	Usage:	cscript.exe DellWarrantyGrabber.vbs
'
'	Note: This must be run under an account with admin rights.
'	This script is provided AS IS with no support or warranties.
'	Use at your own risk!
'=====================================================================
Option Explicit

Dim url, regkey, svctag
Dim warrantyRows, warrantyCols
Dim objShell, objIE, objWMI
Dim i, result

url = "http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=RC956904&l=en&s=hied&~lt=bodyonly&~wsf=tabs&servicetag="
regkey = "HKEY_LOCAL_MACHINE\Software\DellWarrantyInfo"
set objIE=createobject("internetexplorer.application")
set objShell = WScript.CreateObject("WScript.Shell")
set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

If InStr(UCase(objWMI.ExecQuery("Select Manufacturer From Win32_ComputerSystem").ItemIndex(0).Manufacturer), "DELL") = 0 then Err.Raise 2, "This is not a Dell dude!", "No Service Tag"

svctag = objWMI.ExecQuery  ("Select SerialNumber from Win32_BIOS").ItemIndex(0).SerialNumber

result = objShell.Run("reg.exe delete '" & regkey & "' /f", true)
If not result = 0 then Err.Raise result, "Unable to delete registry key!", "Code " & result

result = objShell.Run("reg.exe create '" & regkey & "' /ve", true)
If not result = 0 then Err.Raise result, "Unable to delete registry key!", "Code " & result

objIE.navigate url & svctag
do while objIE.readystate<>4 : wscript.sleep 50 : loop

set warrantyRows = objIE.document.getElementsByTagName("table").item(1).getElementsByTagName("table").item(2).getElementsByTagName("table").item(0).getElementsByTagName("tr")

For i = 1 to warrantyRows.length - 1
set warrantyCols = warrantyRows.item(i).getElementsByTagName("td")

wscript.echo warrantyrows.item(i).innerText

objShell.regWrite regkey & "\" & i & "\", ""
objShell.regWrite regkey & "\" & i & "\Description", warrantyCols.item(0).innerText
objShell.regWrite regkey & "\" & i & "\Provider", warrantyCols.item(1).innerText
objShell.regWrite regkey & "\" & i & "\Warranty Extension Notice", warrantyCols.item(2).innerText
objShell.regWrite regkey & "\" & i & "\Start Date", warrantyCols.item(3).innerText
objShell.regWrite regkey & "\" & i & "\End Date", warrantyCols.item(4).innerText
objShell.regWrite regkey & "\" & i & "\Days Left", warrantyCols.item(5).innerText

Next

13 Responses to “Dell Warranty Information Script”

  1. Thanks for this. This worked great. I did have to modify it a bit to accommodate all the fields that Dell now uses (I assume this changed from when you originally wrote it).

    End of script should now read:

    objShell.regWrite regkey & “\” & i & “\”, “”
    objShell.regWrite regkey & “\” & i & “\Description”, warrantyCols.item(0).innerText
    objShell.regWrite regkey & “\” & i & “\Provider”, warrantyCols.item(1).innerText
    objShell.regWrite regkey & “\” & i & “\Warranty Extension Notice”, warrantyCols.item(2).innerText
    objShell.regWrite regkey & “\” & i & “\Start Date”, warrantyCols.item(3).innerText
    objShell.regWrite regkey & “\” & i & “\End Date”, warrantyCols.item(4).innerText
    objShell.regWrite regkey & “\” & i & “\Days Left”, warrantyCols.item(5).innerText

    • Boyd says:

      Hey Patrick,

      You are correct, it looks like Dell recently added an additional column to the warranty information table (Warranty Extensions). I updated the script with your modifications.

      Thanks!

      • Shrawan says:

        Hi Boyd,

        When i run this vbs file i get an error on line 30 character 1. Please if you can help me.

      • Boyd says:

        Hey Shrawan,

        Is there a specific error messsage that you receive? It looks like line 30 is the WMI call. Is there any chance that WMI is disabled/not installed on the workstation that you tried this on?

  2. [...] I knew I was going to be in over my head if I tried to write a VBScript or Power Shell script myself, so searched online for an existing one instead. I fully expected to have to modify someone’s existing script, but I lucked out and found one that worked with no modifications (other than adapting for Dell’s new fields which this site updated with my mods). The script I’m using can be found at here at iBoyd. [...]

  3. Looks like Dell removed “Warranty Extension Notice” again.

    Should now go back to:

    objShell.regWrite regkey & “\” & i & “\”, “”
    objShell.regWrite regkey & “\” & i & “\Description”, warrantyCols.item(0).innerText
    objShell.regWrite regkey & “\” & i & “\Provider”, warrantyCols.item(1).innerText
    objShell.regWrite regkey & “\” & i & “\Start Date”, warrantyCols.item(2).innerText
    objShell.regWrite regkey & “\” & i & “\End Date”, warrantyCols.item(3).innerText
    objShell.regWrite regkey & “\” & i & “\Days Left”, warrantyCols.item(4).innerText

  4. Dan says:

    In case you’re still looking for a more reliable method, Dell does publish a web service that can be queried at http://xserv.dell.com/jigsawwebservices/AssetService.asmx?op=GetAssetInformation.

    I’m just not sure how to go about doing it using VBScript.

  5. DJohn says:

    Hi guys, is it possible to have the same script created for IBM/Lenovo and HP please?

  6. Mr. Curious says:

    Hi, be aware that DELL has changed their warranty check website. Could you please verify that the current script is still functional even with the new DELL site? Otherwise, could you please have the script updated? Thanks!

  7. [...] Dell made some changes to their support website that broke the Dell Warranty Information Script. After investigating the changes, I determined that the new warranty information URL does not [...]

    • Dnard says:

      I use this URL:
      “http://www.dell.com/support/troubleshooting/us/en/04/Index?c=us&l=en&s=bsd&cs=04&t=warranty&servicetag=”

      you may have to change your code, I’m using vb.net, so I’m not sure how your code is effected.

Leave a Reply

Panorama Theme by Themocracy