title: How can I use Clipboard in vbscript?
body: <p><sup><strong>Editor's note</strong>:<br>
  While this question is specifically about copying a <em>file reference</em> to the clipboard, its generic title led to answers about how to copy / get  <em>text</em>.</sup></p>
  
  <p>As an Emacs user on Windows who often attaches files in mails, I have been looking for a utility to copy a file (<em>not its contents</em>) to the clipboard, just as windows explorer does on righclick/copy).</p>
  
  <p>I just found <a href="https://stackoverflow.com/a/17354470/18573">this</a> right here on SO which uses System.Windows.Forms.Clipboard` in a small program to do exactly that. But it is in C#, for which I don't have immediate access to a compiler. So I am wondering if this can be done and how. </p>
  
  <p>I saw several references such as <a href="https://stackoverflow.com/a/174725/18573">this</a> that the clipboard is not accessible in VBScripting, but msdn <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard%28v=vs.110%29.aspx?cs-save-lang=1&amp;cs-lang=vb#code-snippet-1" rel="nofollow noreferrer">shows</a> documentation for VB so I am risking the question.</p>
  
  <p>I have never written a VBScript before but I did try a few things before asking, starting with running a copy pasted a "Hello world" and then various combinations of <code>CreateObject</code> etc. </p>
  
  <p>Update: I need to call <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard.setfiledroplist.aspx" rel="nofollow noreferrer"><code>Clipboard.SetFileDropList</code></a>, so I do not think I can use <code>ClipboardData</code> as suggested by the answers, it does not have this method. </p>
  
  <p><strong>Update for visitors</strong></p>
  
  <p>The solution I ended up using was to compile the <code>C#</code> itself, I did not know I already had a compiler.</p>
  
  <p><strong>Another update for visitors</strong>
  <a href="https://stackoverflow.com/a/29963268/18573">https://stackoverflow.com/a/29963268/18573</a> is what I am now using, quite happily.</p>