+ Post New Thread
Results 1 to 9 of 9
Scripts Thread, Warranty Lookup HTA - Help in Coding and Web Development; Code in HTA : Code: <html> <head> <title>Test</title> <HTA:APPLICATION Application ID = "Test" APPLICATIONNAME = "Test" BORDER = "DIALOG" BORDERSTYLE ...
  1. #1

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,705
    Thank Post
    3,235
    Thanked 1,044 Times in 966 Posts
    Rep Power
    363

    Warranty Lookup HTA - Help

    Code in HTA :

    Code:
    <html>
    <head>
    <title>Test</title>
    <HTA:APPLICATION
       Application ID = "Test"
       APPLICATIONNAME = "Test"
       BORDER = "DIALOG"
       BORDERSTYLE = "NORMAL"
       CAPTION = "YES"
       CONTEXTMENU = "YES"
       ICON = ""
       INNERBORDER = "YES"
       MAXIMIZEBUTTON = "YES"
       MINIMIZEBUTTON = "YES"
       NAVIGABLE = "NO"
       SCROLL = "AUTO"
       SCROLLFLAT = "NO"
       SELECTION = "NO"
       SHOWINTASKBAR = "YES"
       SINGLEINSTANCE = "NO"
       SYSMENU = "YES"
       VERSION = "1.0"
       WINDOWSTATE = "NORMAL"
       />
    </head>
    <SCRIPT Language="VBScript">
    Sub GetURL
    Dim MType, strSerial, strURL
    MType = Document.getElementById("MachineType").value
    strSerial = Document.getElementById("SerialNum").value
    
    strURL = "'http://support.lenovo.com/templatedata/Web%20Content/JSP/warrantyLookup.jsp?sysMachType=" + MType + "&sysSerial=" + strSerial + "'"
    
    document.getElementById("iwin").innerHTML = "<iframe width='100%' height='600' src=" + Trim(strURL) + "></iframe>"
    
    End Sub
    </SCRIPT>
    <body>
    
    Machine Type : <input type="text" name="MachineType" size="30" maxlength="4"><P>
    Serial Number : <input type="text" name="SerialNum" size="30" maxlength="8"><P>
    <input type="button" value="Get URL" onclick="GetURL">
    <br><br>
    <span id="iwin"></span>
    </body>
    </html>
    I keep getting an error message as per attached screen capture / grab :
    @Arthur, @Steve21 or anyone else

    Found the original URL to use from here : Lenovo Warranty Lookup with SCCM SQL

    Maybe the URL to lookup warranty info is wrong or I am missing something or my coding is totally wrong etc etc ??
    Attached Images Attached Images

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    It's their website more than your script.

    There's a line that pulls the browser locale as a parameter, and that doesn't work properly in HTA, so it can't pull what language you're running, and thus whines. And there's no option within it for "nothing set" aka null.

    Don't think there's much you can do off hand, As the error is produced from their website, you can't disable the error showing in HTA, as it's effectively the webpage, not "Program". If you disable javascript errors I think it'll force that onto IE too as they use the same properties.

    Only way I can think of doing it would be removing the iframe, and pulling the individual elements of HTML you want.

    Or if you want the longer way, you could cheat and test the string you pull from the website, and just remove the crappy line that is breaking before posting it

    Steve

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,705
    Thank Post
    3,235
    Thanked 1,044 Times in 966 Posts
    Rep Power
    363
    Quote Originally Posted by Steve21 View Post

    Only way I can think of doing it would be removing the iframe, and pulling the individual elements of HTML you want.

    Or if you want the longer way, you could cheat and test the string you pull from the website, and just remove the crappy line that is breaking before posting it

    Steve
    No idea how to do either. Maybe just stick to opening there warranty site via a browser favourite / shortcut

  4. #4

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by mac_shinobi View Post
    No idea how to do either. Maybe just stick to opening there warranty site via a browser favourite / shortcut
    If this is just for your own personal thing, you could always just disable javascript error reporting within IE. Assumed it was a deployment kind of thingy, which gets more issues

    Steve

  5. Thanks to Steve21 from:

    mac_shinobi (30th June 2013)

  6. #5

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,705
    Thank Post
    3,235
    Thanked 1,044 Times in 966 Posts
    Rep Power
    363
    Quote Originally Posted by Steve21 View Post
    If this is just for your own personal thing, you could always just disable javascript error reporting within IE. Assumed it was a deployment kind of thingy, which gets more issues

    Steve
    Own project just for me to use, any idea which javascript options I need to disable in IE ( got version 10 of IE ). some screen grabs or how to get to the settings would be great

    Thanks @Steve21

  7. #6

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by mac_shinobi View Post
    Own project just for me to use, any idea which javascript options I need to disable in IE ( got version 10 of IE ). some screen grabs or how to get to the settings would be great

    Thanks @Steve21
    There is 2/3 I think depending on the version, but basically, IE options -> advanced ->

    Then there is disable script debugging, and display notification about every script error options. Think it should be those two.

    Steve

  8. #7


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,573
    Thank Post
    228
    Thanked 851 Times in 730 Posts
    Rep Power
    294
    ooh this looks like the sort of thing i was going to look into over summer. I take it the idea is to programatically go through a list of computers and run their serial/model no's against in this case lenovos database to find out when the warranty expires then presumably dump it back to a spreadsheet/database table?

  9. #8

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,705
    Thank Post
    3,235
    Thanked 1,044 Times in 966 Posts
    Rep Power
    363
    Quote Originally Posted by sted View Post
    ooh this looks like the sort of thing i was going to look into over summer. I take it the idea is to programatically go through a list of computers and run their serial/model no's against in this case lenovos database to find out when the warranty expires then presumably dump it back to a spreadsheet/database table?
    I was just trying to get it to do one machine for the time being but that is not a bad idea

    Quote Originally Posted by Steve21 View Post
    There is 2/3 I think depending on the version, but basically, IE options -> advanced ->

    Then there is disable script debugging, and display notification about every script error options. Think it should be those two.

    Steve

    Any chance of screen grab of what the settings need to look like as I have tried a few but still getting prompted with errors, also tried adjusting the meta tag type but then it does not load the web page, arrggghhhh

  10. #9

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by mac_shinobi View Post
    I was just trying to get it to do one machine for the time being but that is not a bad idea




    Any chance of screen grab of what the settings need to look like as I have tried a few but still getting prompted with errors, also tried adjusting the meta tag type but then it does not load the web page, arrggghhhh
    Will try to if I get a minute, will need to find a spare machine to "unlockdown"

    Steve

  11. Thanks to Steve21 from:

    mac_shinobi (1st July 2013)

SHARE:
+ Post New Thread

Similar Threads

  1. Warranty status hta or script
    By mac_shinobi in forum Coding
    Replies: 13
    Last Post: 27th February 2012, 07:43 AM
  2. Got a reservation, lookup is wrong - help!
    By mats in forum Wireless Networks
    Replies: 2
    Last Post: 11th October 2011, 03:36 PM
  3. Replies: 2
    Last Post: 2nd September 2011, 12:10 PM
  4. VBS/HTA and registry - help
    By Gerry in forum Scripts
    Replies: 7
    Last Post: 7th July 2009, 10:59 AM
  5. excel lookup problem, can someone help me please?
    By RabbieBurns in forum Windows
    Replies: 3
    Last Post: 2nd July 2008, 12:51 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •