На WSH:
Скрытый текст
Код:

Option Explicit
Dim strSourceFolder
Dim objFSO
Dim objFile
Dim strValue
If WScript.Arguments.Count = 1 Then
strSourceFolder = WScript.Arguments.Item(0)
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strSourceFolder) Then
With WScript.CreateObject("VBScript.RegExp")
.Pattern = "(.+)#.*"
For Each objFile In objFSO.GetFolder(strSourceFolder).Files
If .Test(objFile.Name) Then
If IsEmpty(strValue) Then
strValue = .Execute(objFile.Name).Item(0).Submatches.Item(0) & "*"
Else
strValue = strValue & " " & .Execute(objFile.Name).Item(0).Submatches.Item(0) & "*"
End If
End If
Next
With objFSO.CreateTextFile(objFSO.BuildPath(strSourceFolder, "Result.txt"))
.Write strValue
.Close
End With
End With
Else
WScript.Echo "Can't find source folder [" & strSourceFolder & "]."
WScript.Quit 2
End If
Set objFSO = Nothing
Else
WScript.Echo "Usage: wscript.exe """ & WScript.ScriptName & """ <Source folder>"
WScript.Quit 1
End If
WScript.Quit 0
Исходная папка задаётся параметром скрипта. Для Total Commander можно использовать меню запуска, панель инструментов и т.п. с аргументом «"%P"».
А что Вы потом с содержимым этого файла делать будете?