title: Convert Hex String into Array and Write it to registry - VBSCript
body: <p>Here is a string named "Hex" with the value below:</p>
  
  <pre><code>43,00,23,00,01
  </code></pre>
  
  <p>Now I'm trying to write it into a binary registry key, for this purpose I need to use the command below:</p>
  
  <pre><code>arrValues = Array(1,2,3)
  </code></pre>
  
  <p>I have replaced "1,2,3" with "Hex" but it seems it is not working:</p>
  
  <pre><code>arrValues = Array(Hex)
  </code></pre>
  
  <p>It means it can not parse "Hex" as an array so I need to convert it into an array then use it in above command. Can you please tell me How can I do that? </p>
  
  <p>Here is the script I'm using to write a binary value:</p>
  
  <pre><code>Const HKEY_CURRENT_USER = &amp;H80000001
  
  strComputer = "."
  
  Set objRegistry = GetObject _
      ("winmgmts:\\" &amp; strComputer &amp; "\root\default:StdRegProv")
  
  strKeyPath = "Software\DownloadManager\FoldersTree\Compressed"
  strValueName = "pathW"
  arrValues = Array(1,2,3)
  
  errReturn = objRegistry.SetBinaryValue _
      (HKEY_CURRENT_USER, strKeyPath, strValueName, arrValues)
  </code></pre>