Advertisement
lordhenthai

get serial number of lenovo pc's using batch warranty lookup

Sep 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim MachineType
  2. MachineType = InputBox("Enter Lenovo pc's machine type")
  3. Dim SerialNumber
  4. SerialNumber = InputBox("Now enter the computers serial number or Mei")
  5. Set objExcel = CreateObject("Excel.Application")
  6. objExcel.Visible = False
  7. Set objWorkbook = objExcel.Workbooks.Open("C:\Program Files (x86)\EiToimi\Warranty_Batch_Lookup_Template.xlsx")
  8. objExcel.Cells(2,1).Value = ""
  9. objExcel.Cells(3,1).Value = ""
  10. objExcel.Cells(4,1).Value = ""
  11. objExcel.Cells(5,1).Value = ""
  12. objExcel.Cells(2,2).Value = ""
  13. objExcel.Cells(3,2).Value = ""
  14. objExcel.Cells(4,2).Value = ""
  15. objExcel.Cells(5,2).Value = ""
  16. objExcel.Cells(2,1).Value = MachineType
  17. objExcel.Cells(2,2).Value = SerialNumber
  18. objWorkbook.Save
  19. objExcel.Quit
  20.  
  21. Dim URL
  22. Dim IE
  23. Dim objWshShell
  24. Set WshShell = CreateObject("WScript.Shell")
  25. Set objWshShell = Wscript.CreateObject("Wscript.Shell")
  26. Set IE = CreateObject("internetexplorer.application")
  27. URL = "https://pcsupport.lenovo.com/fi/en/warrantylookup/batchquery"
  28.  
  29.  
  30. IE.Visible = True
  31. IE.Navigate URL
  32.  
  33.  Do While IE.Busy
  34.     WScript.Sleep 100
  35.  Loop
  36.  
  37.  WshShell.SendKeys "C:\Program Files (x86)\EiToimi\Warranty_Batch_Lookup_Template.xlsx"
  38.  WshShell.SendKeys "{ENTER}"
  39.  
  40.  
  41.  Set objFSO = CreateObject("Scripting.FileSystemObject")
  42. objFSO.MoveFile "C:\Program Files (x86)\EiToimi\Warranty_Batch_Lookup_Template.xlsx", "C:\Program Files (x86)\EiToimi\Warranty_Batch_Lookup_Template.xlsx"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement