SaveListOfFiles.vbs

A SendTo script by Richard A. DeVeneziaSend Feedback

Save a list of files highlighted in Windows Explorer

Place the script in your SendTo folder. In a Windows Explorer listing pane, highlight one or more files. Right click on the selection and send to SaveListOfFiles.vbs. A text file listing the highlighted files will be created. Useful for saving search results.

Download the script or copy it from below.

After saving a temporary file is created. Rename and move the file to a more permanent location if necessary.

'
' SaveListOfFiles.vbs
' Richard A. DeVenezia, 02/23/2005
' www.devenezia.com
'
' Send me some mail if you find this useful.
'
' Purpose: In Explorer, select files and be able to save the names of the files selected.
'          Very useful for saving results of searches.
'

dim ws, list, fso, folder, filename, file

Set ws = CreateObject("WScript.Shell")

list = "Save this list to a permanent file" & vbCrLf & vbCrLf

for each arg in wscript.arguments
  list = list & arg & vbCrLf
next

Set fso = CreateObject("Scripting.FileSystemObject")

filename = fso.GetSpecialFolder(2) & "\Move-and-rename-this-List-of-files.txt"

Set file = fso.CreateTextFile(filename)

file.Write list
file.Close

ws.Run "Explorer /e,/select," & chr(34) & filename & chr(34)

This page was last updated 23 February 2005.