title: Turn clipboard into a variable inside a batch file
body: <p>First let me insist on the fact that I am completely new to batch coding, I have seen some code over the years and am used to using cmd, but never really delved into trying to accomplish complex tasks in a batch by myself.</p>
  
  <p>So, basically I would like to copy some text to the clipboard (usernames, so will never exceed one line), then simply double clicking on a batch file to create a folder with that username and a few other tasks that aren't relevant here.</p>
  
  <p>Anyway, I've got that second part down (with the username in question hardcoded in the batch), but not the clipboard to variable part.</p>
  
  <p>I have read this thread :
  <a href="https://stackoverflow.com/questions/6832203/access-clipboard-in-windows-batch-file/27277546#27277546">Access clipboard in Windows batch file</a></p>
  
  <p>And especially rojo's answer which is very interesting. The solution I'm interested in is the "Update 2" one, with one line of code using Powershell:</p>
  
  <pre><code>powershell -sta "add-type -as System.Windows.Forms; [windows.forms.clipboard]::GetText()"
  </code></pre>
  
  <p>However, there are a few issues with me using it:</p>
  
  <ul>
  <li>I learned the existence of powershell reading this, so I don't really know how to decipher the code, and turning it into a variable that I could use later in other lines.</li>
  <li>I'm using Windows 10 so I believe powershell is on my computer, however I have no idea if using that line would be allowed in a normal batch file?</li>
  </ul>
  
  <p>Anyway, first I want to thank rojo for his solutions, they are great and I will continue searching for a way to resolve my problem, and also thanks to anyone that would be willing to help me understand and hopefully resolve this!</p>