SAP ECC6 SOLUTION MANAGER KEY 生成脚本 (VBS)

前端之家收集整理的这篇文章主要介绍了SAP ECC6 SOLUTION MANAGER KEY 生成脚本 (VBS)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. ''''''''''''''''''''''''''''''''''''''
  2. ' Solution Manager Key 生成器 '
  3. '复制本文档,存为 SolManKeyGen.vbs '
  4. ' 执行 '
  5. ''''''''''''''''''''''''''''''''''''''
  6. '-------------------------------------------------------
  7. Dim SIDs,SNs,SERVs,msg,ENDs,KEYs
  8. msg="系统标识 (3位)"
  9. SIDs=InputBox(msg,"Solution Manager Key 生成器")
  10. msg="系统编号 (2位)"
  11. SNs=InputBox(msg,"Solution Manager Key 生成器")
  12. msg="主机名(最多15位)"
  13. SERVs=InputBox(msg,"Solution Manager Key 生成器")
  14. KEYs=SolManKeyGen(SIDs,SERVs)
  15. msg="Solution Manager Key"
  16. ENDs=InputBox(msg,"Solution Manager Key 生成器",KEYs)
  17. '-------------------------------------------------------
  18. Function SolManKeyGen(SIDst,SNst,SERVst)
  19. Dim SIDSNhex(5)
  20. Dim SERVhex(15)
  21. Dim reshex(5)
  22. SIDSNstr = UCase(SIDst) + UCase(SNst)
  23. SERVstr = UCase(SERVst)
  24. For arrcnt = 1 To 5
  25. SIDSNhex(arrcnt) = Asc(Mid(SIDSNstr,arrcnt,1))
  26. Next
  27. For arrcnt = 1 To Len(SERVstr)
  28. SERVhex(arrcnt) = Asc(Mid(SERVstr,1))
  29. Next
  30. For arrcnt = Len(SERVstr) + 1 To 15
  31. SERVhex(arrcnt) = 0
  32. Next
  33. If (Len(SERVstr) > 0) Then
  34. If (Len(SERVstr) < 5) Then
  35. For arrcnt = Len(SERVstr) + 1 To 5
  36. SERVhex(arrcnt) = Asc(" ")
  37. Next
  38. End If
  39. End If
  40. If (Len(SERVstr) > 5) Then
  41. If (Len(SERVstr) < 10) Then
  42. For arrcnt = Len(SERVstr) + 1 To 10
  43. SERVhex(arrcnt) = Asc(" ")
  44. Next
  45. End If
  46. End If
  47. If (Len(SERVstr) > 10) Then
  48. If (Len(SERVstr) < 15) Then
  49. For arrcnt = Len(SERVstr) + 1 To 15
  50. SERVhex(arrcnt) = Asc(" ")
  51. Next
  52. End If
  53. End If
  54. For arrcnt = 1 To 5
  55. reshex(arrcnt) = ((((0 Xor SIDSNhex(arrcnt)) Xor SERVhex(arrcnt)) Xor SERVhex(arrcnt + 5)) Xor SERVhex(arrcnt + 10))
  56. Next
  57. reshex(1) = reshex(1) Xor 84 Xor 0
  58. reshex(2) = reshex(2) Xor 131 Xor 11
  59. reshex(3) = reshex(3) Xor 194 Xor 46
  60. reshex(4) = reshex(4) Xor 52 Xor 105
  61. reshex(5) = reshex(5) Xor 119 Xor 188
  62. hexstr = "0123456789ABCDEF"
  63. resstr = ""
  64. For arrcnt = 1 To 5
  65. hihex = reshex(arrcnt) \ 16
  66. lohex = reshex(arrcnt) Mod 16
  67. resstr = resstr + Mid(hexstr,hihex + 1,1) + Mid(hexstr,lohex + 1,1)
  68. Next
  69. SolManKeyGen = resstr
  70. End Function

猜你在找的Windows相关文章