title: VBScript find path folder then input path into text txt file
body: <p>I have been trying to find and write a vbscript that enables me to find a filepath and then insert it's location into a text.txt file</p>
  
  <p><strong>For example:</strong></p>
  
  <p>click on Find.vbs</p>
  
  <p>window opens to search for folder or drive</p>
  
  <p>select c:\test folder</p>
  
  <p>are you sure you want to select c:\test folder? prompt</p>
  
  <p>click yes button</p>
  
  <p><strong>in the text.txt file</strong> </p>
  
  <p>the word driveselect changes to c:\test</p>
  
  <p>I found this that opens the window and then lets me select a file, it then opens a msgbox to show the file name, but will not select a folder only</p>
  
  <pre><code>Set wShell=CreateObject("WScript.Shell")
  Set oExec=wShell.Exec("mshta.exe ""about:&lt;input type=file id=FILE&gt;
  &lt;script&gt;FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);&lt;/script&gt;""")
  sFileSelected = oExec.StdOut.ReadLine
  wscript.echo sFileSelected
  </code></pre>
  
  <p>there are a few codes that i found to change the text in a word file, but not text file with input.</p>
  
  <p>any help would be greatly appreciated.</p>
  
  <p>thanks</p>