Option
Explicit
Sub
Test()
Dim
strFindExpr
As
String
Dim
strFolder
As
String
strFindExpr =
"\Gesamtausgaben"
strFolder = "C:\"
Dim
strCmd
As
String
Dim
strResult
As
String
strCmd =
"dir "
"$FOLDER"
" /A:D /B /S | find /I "
"$FINDEXPR"
""
strCmd = Replace$(strCmd,
"$FOLDER"
, strFolder, Compare:=vbBinaryCompare)
strCmd = Replace$(strCmd,
"$FINDEXPR"
, strFindExpr, Compare:=vbBinaryCompare)
With
CreateObject(
"WScript.Shell"
)
strResult = .Exec(
"%comspec% /C "
& strCmd).StdOut.ReadAll
End
With
Debug.Print
"[RESULTS]"
Debug.Print strResult
End
Sub