title: Use VBscript to paste data into a txt file and save
body: <p>I need to paste data from clipboard (Ctrl+V) into a text file and save it.</p>
  
  <p>I already did some research and it seems that a <code>text file</code> doesn't have a method like <code>SaveAs</code>.</p>
  
  <p>With code below, I could create a new text file and paste data into it, but I can't <code>Save</code> it:</p>
  
  <pre><code>Set WShshell = CreateObject("WScript.Shell")
  WShshell.run "c:\WINDOWS\system32\notepad.exe",1
  WshShell.AppActivate "notepad"
  WShshell.SendKeys "^V" 
  </code></pre>
  
  <p>I understand there is a method called <code>CreateTextFile</code>, but seems I can't perform <code>paste</code> with it.</p>
  
  <p>I also tried to combine those two:</p>
  
  <pre><code>Set WShshell = CreateObject("WScript.Shell")
  Set fso = CreateObject("Scripting.FileSystemObject")
  fso.CreateTextFile "c:\1.txt",true
  WshShell.AppActivate "notepad"
  WShshell.SendKeys "^V"
  </code></pre>
  
  <p>But nothing happened...</p>