Assign empty system variable using setx
<p>I need a system variable and assign an empty string value to it. I've tried</p>

<pre><code>setx samplepassword ""
</code></pre>

<p>But upon <code>echo %samplepassword%</code> , what should be an empty string is instead <code>%samplepassword%</code>. Now I found this in the docs</p>

<blockquote>
  <p>Setting value of "" (empty quotes) will appear to delete the variable
  - it's not shown by SET but the variable name will remain in the registry.</p>
</blockquote>

<p><a href="http://ss64.com/nt/setx.html" rel="nofollow">http://ss64.com/nt/setx.html</a></p>

<p>How can I assign an empty system variable using setx?</p>

<p>Update:
I have checked the environment variables via the Windows GUI: <code>Control Panel | System | Advanced | Environment Variables</code> and saw that the <code>DB_PASSWORD</code> was indeed initialized with an empty string value. But why does executing <code>echo %samplepassword%</code> give me the above output? I have opened a new instance of cmd to be precise.</p>