1

is there any to convert a string into Hex using Vb-script?

here there is a simple guide doing this, but it seems it works only for numbers not alphabets.

http://www.w3schools.com/vbscript/func_hex.asp

Inside Man
  • 4,194
  • 12
  • 59
  • 119

1 Answers1

4

Here it is:

strString = "test"
strHex =""
For i=1 To Len(strString)
    strHex = strHex + Hex(Asc(Mid(strString,i,1)))
Next

WScript.Echo strHex
Inside Man
  • 4,194
  • 12
  • 59
  • 119
  • 3
    Best to use `&` instead of `+` for string concatenation. Don't make VBScript guess whether `10 + 20` should be `1020` or `30`. – Bond Jun 21 '14 at 13:37