Dell ServieTag an URL anfügen

  • Hallo,

    ich habe ein AutoIT Script bekommen um von Dell den ServiceTag in einen Express Service Code umzuwandeln. Dieses Script möchte ich gerne erweitern um zwei Funktionen, direkter zugriff auf die Treiber Seite und direkt auf die Garantie Seite zu kommen.

    Mein Problem ist nun die übergabe der eingegeben Service Tag hinten an die URL

    Könnt ihr mir sagen was ich falsch mache:

    [autoit]

    ShellExecute("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=19&l=en&s=bsd&~ck=anavml&~tab=1&servicetag=" & $service_tag)

    [/autoit]


    So funktioniert es, allerdings wird dann die falsche ServiceTag verwendet.

    [autoit]

    ShellExecute("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=19&l=en&s=bsd&~ck=anavml&~tab=1&servicetag=")

    [/autoit]

    Habe hier im Forum so etwas ähnliches gefunden, allerdings wird dort nicht beschrieben wie die Lösung ist. Hoffe ihr könnt mir weiterhelfen :)

    Vielen Dank
    Daniel46220

  • Ich hab keinen Dell aber wenn ich http://support.dell.com/support/topics…vicetag=5RFDP01 aufrufe, dann lande ich auf der Supportseite für das passende Produkt.

    Kannst du mehr von deinem Skript zeigen? Wie ermittelst du den Service-Tag? Hast du ihn schonmal ausgegeben um zu sehen, ob er korrekt ermittelt wird?

  • Ich hab keinen Dell aber wenn ich http://support.dell.com/support/topics…vicetag=5RFDP01 aufrufe, dann lande ich auf der Supportseite für das passende Produkt.

    Kannst du mehr von deinem Skript zeigen? Wie ermittelst du den Service-Tag? Hast du ihn schonmal ausgegeben um zu sehen, ob er korrekt ermittelt wird?

    Ja so soll es dann sein damit am Ende automatisch der Service Tag angehängt wird.

    Den Service Tag haben wir bei uns in der Datenbank, diesen kann man ja über das BIOS auslesen lassen. Im Anhang findest du das Script, das ich im Internet mal gefunden hab.

    Viele Grüße

  • Das Problem versteh ich dennoch nicht. Auch aus dem Skript heraus wird der Link korrekt aufgerufen .

    genau ohne den Service Tag wird der Link korrekt aufgerufen. Jedoch möchte ich den eingegeben Server Tag an den Linken hinten anfügen.

    ohne Service Tag (funktioniert es)
    http://support.dell.com/support/topics…b=1&servicetag=


    mit Service Tag (so soll es aussehen)
    http://support.dell.com/support/topics…vicetag=5RFDP01



    funktioniert es nicht und ich hab keine ahnung was ich dahinter setzen muss, damit der Service Tag korrekt übergeben wird.


    grüße

  • Wie i2c schon sagt liegt das Problem nicht am Shellexecute sondern wohl eher an dem anderen Zeug das du so machst.
    Damit das Script zuverlässig funktioniert solltest du paar Dinge ändern.
    Statt dem ganzen Tab gesende solltest du GUICtrlSetState ($CTRL, $GUI_FOCUS ) verwenden
    Statt Send("^c") gibt es bestimmt auch was besseres. Was ist das für ein Fenster namens "Rank"?
    Lässt sich das service tag nicht besser auslesen? Controlgettext() etc.

  • Also bei mir und mit meiner "Service Tag" funktioniert es sofort.

    Mein kompletter Link sieht so aus:
    http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=19&l=en&s=bsd&~ck=anavml&~tab=1&servicetag=?S?G?4 (?=verändert)


    So habe ich das Script genutzt !!!

    Spoiler anzeigen
    [autoit]


    ; ======================================================================================================
    ; Script Name: Convert Dell Service Tag <=> Express Service Code
    ; Filename: dell_convert.au3
    ; Compiled as: dell_convert.exe
    ; Description:
    ; A basic utility that converts the Dell Service Tag to its corresponding
    ; Express Service Code and vice versa.
    ; Notes and Sources:
    ; Dell uses a single serial number to uniquely identify its products. That
    ; serial number is represented two different ways: as a base-36 number (the
    ; Service Tag) and as a base-10 number (the Express Service Code). Thus, the
    ; conversion between the two is simply a matter of converting between base-10
    ; and base-36.
    ; As an exercise in how to build a simple, but fully functional GUI using
    ; the AutoITv3 scripting language, as well as hoping to better understand the
    ; processes involved in making the conversion, I set out to write this script.
    ; There are four routines that will be employed: building the GUI, the
    ; input loop, the base conversion routine, and a Service Tag validation routine,
    ; Each of these routines are copiously annotated to ensure maximum
    ; readability and understandability.
    ; The pseudocode that follows was found as I was searching for an
    ; understanding of the processes involved in converting between bases. The
    ; author's full discussion can be found at <http://www.geocities.com/oosterwal/
    ; computer/numericbase.html>.
    ; Pseudocode for the base conversion:
    ; string function Base2Base(InputNumber as string, InputBase as integer, OutputBase as integer)
    ; Dim J, K, DecimalValue, X, MaxBase, InputNumberLength as integer
    ; Dim NumericBaseData, OutputValue as string
    ; NumericBaseData = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ; MaxBase = Length(NumericBaseData)
    ; if (InputBase > MaxBase) OR (OutputBase > MaxBase) then
    ; Base2Base = "N/A"
    ; return
    ; end if
    ; */ Convert InputNumber to Base 10 /*
    ; InputNumberLength = Length(InputNumber)
    ; DecimalValue = 0
    ; for J = 1 to InputNumberLength
    ; for K = 1 to InputBase
    ; if mid(InputNumber, J, 1) == mid(NumericBaseData, K, 1) then
    ; DecimalValue = DecimalValue+int((K-1)*(InputBase^(InputNumberLength-J))+.5)
    ; end if
    ; next K
    ; next J
    ; */ Convert the Base 10 value (DecimalValue) to the desired output base /*
    ; OutputValue = ""
    ; while DecimalValue > 0
    ; X = int(((DecimalValue/OutputBase)-int(DecimalValue/OutputBase))*OutputBase+1.5)
    ; OutputValue = mid(NumericBaseData, X, 1)+OutputValue
    ; DecimalValue = int(DecimalValue/OutputBase)
    ; loop
    ; Base2Base = OutputValue
    ; return
    ; end
    ; ======================================================================================================

    [/autoit] [autoit][/autoit] [autoit]

    ; Building the GUI
    ; -------------------------------------
    ; In order to utilize the $GUI_EVENT_CLOSE constant, we must include the following library
    #include <guiconstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ; Create the GUI
    ; Create a decent sized window, centered on the screen
    guicreate("Service Tag <=> Express Service Code", 370, 160, -1, -1)
    ; Create the Instructions label on the GUI, so the User knows what's going on
    $instructions_label = guictrlcreatelabel("Enter either the Service Tag or the Express Service Code and press {TAB}", 10, 10)
    ; Create the Service Tag and Express Service Code labels for the input boxes
    $service_tag_label = guictrlcreatelabel("Service Tag:", 10, 40)
    $express_service_code_label = guictrlcreatelabel("Express Service Code:", 10, 70)
    ; Create the Service Tag and Express Service Code input boxes
    $service_tag_input = guictrlcreateinput("", 125, 35, 230)
    $express_service_code_input = guictrlcreateinput("", 125, 65, 230)
    ; Create the Instructions label on the GUI, so the User knows what's going on
    $drivers_label = guictrlcreatelabel("Please copy the Service Tag to your Clipboard", 10, 95)
    $drivers2_label = guictrlcreatelabel("and then use Drivers and Warranty Button", 10, 110)
    ; Add an Drivers button, explaining this work and the license it is released under
    $drivers_button = guictrlcreatebutton("Drivers...", 10, 130, 75)
    ; Add an Warranty button, explaining this work and the license it is released under
    $warranty_button = guictrlcreatebutton("Warranty...", 90, 130, 75)
    ; Add a Reset Inputs button, that allows the two input boxes to be cleared
    $reset_button = guictrlcreatebutton("Reset Inputs", 200, 130, 75)
    ; Add an Exit button
    $exit_button = guictrlcreatebutton("Exit", 280, 130, 75)
    ; When the window is created, it is initially hidden, the following line makes it visible
    guisetstate(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    ; The Input Loop
    ; -------------------------------------
    ; This while-wend loop takes any inputs and, if they match what we're looking for, calls the appropriate function

    [/autoit] [autoit][/autoit] [autoit]

    while 1
    $input = guigetmsg()
    select
    case $input = $gui_event_close
    exitloop ; Leave the while-wend and continue executing the script
    case $input = $exit_button
    exitloop ; Same as above
    case $input = $reset_button
    guictrlsetdata($express_service_code_input, "") ; Clears the input box
    guictrlsetdata($service_tag_input, "") ; Clears the input box
    send("{TAB}")
    send("{TAB}") ; These two tabs move focus back to the Service Tag input box
    case $input = $service_tag_input
    ; Takes the data entered and passes it to the _baseconvert function for processing
    guictrlsetdata($express_service_code_input, _baseconvert(guictrlread($service_tag_input), 36, 10))
    guictrlsetdata($service_tag_input, stringupper(guictrlread($service_tag_input)))
    send("{TAB}")
    send("{TAB}")
    send("{TAB}")
    send("{TAB}")
    send("{TAB}") ; These five tabs move focus to the Express Service Code input box
    case $input = $express_service_code_input
    ; Takes the data entered and passes it to the _baseconvert function for processing
    guictrlsetdata($service_tag_input, _baseconvert(guictrlread($express_service_code_input), 10, 36))
    send("{TAB}")
    send("{TAB}")
    send("{TAB}") ; These three tabs move focus back to the Service Tag input box
    case $input = $drivers_button
    ; The following line creates a dialog box that shows the information needed
    Opt ("WinTitleMatchMode", 2)
    WinActivate("Rank", "")
    Sleep(10)
    Send("^c")
    $Keyword = ClipGet()
    ShellExecute("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=19&l=en&s=bsd&~ck=anavml&~tab=1&servicetag=" & ($Keyword)) ;hier
    send("{TAB}")
    send("{TAB}")
    send("{TAB}") ; These three tabs move focus back to the Service Tag input box
    case $input = $warranty_button
    ; The following line creates a dialog box that shows the information needed
    Opt ("WinTitleMatchMode", 2)
    WinActivate("Rank", "")
    Sleep(10)
    Send("^c")
    $Keyword = ClipGet()
    ShellExecute ("http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&cs=19&l=en&s=bsd&~ck=anavml&~tab=1&servicetag=" & ($Keyword))
    send("{TAB}")
    send("{TAB}")
    send("{TAB}") ; These three tabs move focus back to the Service Tag input box
    endselect
    wend

    [/autoit] [autoit][/autoit] [autoit]

    ; End the program
    exit

    [/autoit] [autoit][/autoit] [autoit]

    ; The Base Conversion Routine
    ; -------------------------------------
    ; This routine calls the Service Tag Validation Routine. It could be very easily modified to handle a variety of situations.
    func _baseconvert($input_number, $input_base, $output_base)
    ; Check to see if the Service Tag is valid
    if number($input_base) = 36 then
    if _validservicetag($input_number) = 0 then
    return "ERROR"
    endif
    endif

    [/autoit] [autoit][/autoit] [autoit]

    ; Define some important variables
    $numericbasedata = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    $maxbase = stringlen($numericbasedata)

    [/autoit] [autoit][/autoit] [autoit]

    ; Make sure the function call is within specified parameters
    if $input_base > $maxbase or $output_base > $maxbase then
    msgbox(0, "Error", "Input or Output Base exceeds Maximum Base in Function _baseconvert")
    return 0
    endif

    [/autoit] [autoit][/autoit] [autoit]

    $input_number = stringupper($input_number)

    [/autoit] [autoit][/autoit] [autoit]

    ; Convert the input number to base 10
    $input_number_length = stringlen($input_number)
    $decimalvalue = 0
    for $j = 1 to $input_number_length
    for $k = 1 to $input_base
    if stringmid($input_number, $j, 1) == stringmid($numericbasedata, $k, 1) then
    $decimalvalue = $decimalvalue + int(($k - 1) * ($input_base ^ ($input_number_length - $j)) + .5)
    endif
    next
    next

    [/autoit] [autoit][/autoit] [autoit]

    ; Convert the base 10 value to the the output base
    $outputvalue = ""
    while $decimalvalue > 0
    $x = int((($decimalvalue / $output_base) - int($decimalvalue / $output_base)) * $output_base + 1.5)
    $outputvalue = stringmid($numericbasedata, $x, 1) & $outputvalue
    $decimalvalue = int($decimalvalue / $output_base)
    wend

    [/autoit] [autoit][/autoit] [autoit]

    ; If we're outputting a Service Tag, check to see if it is valid
    if number($input_base) = 10 then
    if _validservicetag($outputvalue) = 0 then
    return "ERROR"
    endif
    endif
    return $outputvalue
    endfunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Service Tag Validation Routine
    ; -------------------------------------
    func _validservicetag($service_tag)
    ; In order for the Service Tag to be valid, it must be between 5 and 7 characters and it must consist of only letters and numbers
    ; First, we'll make sure that there are no less than five and no more than seven characters
    if stringlen($service_tag) <= 7 and stringlen($service_tag) >= 5 then
    ; Finally, we'll make sure that only alphanumeric characters exist in the string
    if stringisalnum($service_tag) then
    return 1
    endif
    else
    return 0 ; On failure, the function returns 0
    endif
    endfunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

    Einmal editiert, zuletzt von Alina (5. November 2013 um 17:33)

  • Ich konnte den Link mit angehängtem Service-Tag manuell aufrufen und mir wurde die korrekte Supportseite (Latitude25irgendwas) ausgegeben. Ich konnte das selbe Ergebnis mit dem selben Servicce-Tag mit dem von dir geposteten Skript erzielen. Alina bestätigt die korrekte Funktionsweise ebenfalls.

    Ich denk jetzt mal in eine andere Richtung .... in deinem Standardbrowser ist nicht zufällig ein Keks von Dell hinterlegt, der unter umständen einen anderen Service-Tag beinhaltet und den Aufruf stört?

  • Zitat

    Ich denk jetzt mal in eine andere Richtung .... in deinem Standardbrowser ist nicht zufällig ein Keks von Dell hinterlegt, der unter umständen einen anderen Service-Tag beinhaltet und den Aufruf stört?

    DELL hinterläßt in diesem Fall, gemäß Hotline mit den ich heute telefoniert habe, keinen Krümelkeks. Also ist das nicht das Problem.
    Evtl. eine "Null" mit einem "O" (Buchstabe nach "N" ;) ) versehentlich eingegeben?

    Habe es bei drei DELL-PC's getestet und einwandfrei.

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr