title: Update registry using VBS
body: <p>I'm trying to update the legal caption on our PCs using a VBScript. So far, I've been able to read values but I can't seem to get it to write any values. I don't get an error when I run the script, it just doesn't change anything. It's the first time I'm doing this and I have limited experience; any insight would be appreciated:</p>
  
  <pre><code>Dim objShell
  Dim strMessage, strWelcome, strWinLogon
  
  ' Set the string values
  strWelcome = "legalnoticecaption"
  strMessage = "did this work"
  strWinLogon = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\"
  
  ' Create the Shell object
  Set wshShell = CreateObject("WScript.Shell")
  
  'Display string Values
  Wscript.Echo "key to update: " &amp; strWelcome
  Wscript.Echo "key value to enter: " &amp; strMessage
  Wscript.Echo "Existing key value: " &amp; wshShell.RegRead(strWinLogon &amp; strWelcome)
  
  
  ' the crucial command in this script - rewrite the registry
  wshShell.RegWrite strWinLogon &amp; strWelcome, strMessage, "REG_SZ"
  
  ' Did it work?
  Wscript.Echo "new key value: " &amp; wshShell.RegRead(strWinLogon &amp; strWelcome)
  
  set wshShell = Nothing
  </code></pre>
  
  <p>NOTE: These are testing values at the moment.</p>