Maybe this will work..
'// Script for Total Commander, v00.1, Stefan, 2019-08-19 Mon 11:59:55
'
Execute command x for every file in all sub folders (see Function ExecuteTool)
' Works on current active TC panel folder directory
'TC Button
' Command: "D:\rive\Path to\this.vbs"
' Parameter:
' Start path:
' Icon: wciconex.dll
' Tooltip: Execute command x for every file in all sub folders
USER SETTINGS:
Startfolder = "." '//current TC active panel, working dir
Logfile = "___streamslog_1.txt"
StreamsExePath = "C:\Temp\streams.exe"
Code: Select all
'//Found at: https://ghisler.ch/board/viewtopic.php?p=358378#p358378
'// Script for Total Commander, v00.1, Stefan, 2019-08-19 Mon 11:59:55
' Execute command x for every file in all sub folders (see Function ExecuteTool)
' Works on current active TC panel folder directory
' TC Button
' Command: "D:\rive\Path to\this.vbs"
' Parameter:
' Start path:
' Icon: wciconex.dll
' Tooltip: Execute command x for every file in all sub folders
'//USER SETTINGS:
Logfile = "___streamslog_1.txt"
Startfolder = "." '//current TC active panel, working dir
'// and see Function ExecuteTool below at the end, for settings of the Tool to execute !
'//=============================================================
Set FSO = CreateObject("Scripting.FileSystemObject")
SET WSO = CreateObject("WScript.Shell")
objStartFolder = FSO.GetAbsolutePathName(Startfolder)
MB = MsgBox("Work in folder: " &vbLF & objStartFolder _
& vbLF&vbLF&"Continue: [Yes]/[No]?"&vbLF&vbLF _
, VBYesNo+vbQuestion,"Total Commander VBScript")
If (MB = vbNo) Then WScript.Quit
MsgBox "OK, we start... wait for the Done! message!" _
, vbOKCancel,"Total Commander VBScript"
Set objFolder = FSO.GetFolder(objStartFolder)
'// get Main folder "objStartFolder":
Set colFilesMainFld = objFolder.Files
For Each objFile in colFilesMainFld
sOUT = sOUT & objFile.Path & vbCRLF
'ExecuteTool objFile.Path
Next
'// get sub folders of "objStartFolder":
ShowSubfolders FSO.GetFolder(objStartFolder)
'//Output, write to file in current working dir:
Set NewFile = FSO.CreateTextFile(Logfile, True)
NewFile.WriteLine(sOUT)
NewFile.Close
MsgBox "Done!",VBInformation,"Total Commander VBScript"
'//=============================================================
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
'Wscript.Echo Subfolder.Path
Set objFolder = FSO.GetFolder(Subfolder.Path)
Set colFiles = objFolder.Files
'//If no file in folder, get just the folder name: (and add a backslash for our CreateFolderStructure script)
If colFiles.count = 0 Then
Set oSubFld = objFolder.SubFolders
If oSubFld.count = 0 Then sOUT = sOUT & objFolder.Path & "\" & vbCRLF
Set oSubFld = Nothing
End If
For Each objFile in colFiles
'objFile.Name or objFile.Path
sOUT = sOUT & objFile.Path & vbCRLF
ExecuteTool objFile.Path
Next
ShowSubFolders Subfolder
Next
End Sub
'//=============================================================
Function ExecuteTool(strFullPath)
'//USER SETTINGS:
StreamsExePath = "C:\Temp\streams.exe"
'// WSO.Run strCommand [,intWindowStyle 0=Hide 1=Activate 2=mini 3=maxi ...] [,bWaitTillFinish? True/False]
WSO.Run StreamsExePath & " -d -nobanner " & strFullPath, 0, true
End Function 'ExecuteTool(strFullPath)
'//=============================================================