Oh, so many help? Great forum. Here is my solution, a VBScript:
- read in whole "Homines.txt"
- split long string at comma into an array
- for each array item
- - - trim whitespaces
- - - check if folder already exists, if not, create the folder
Code: Select all
' Total Commander VBScript "Create Folders from List.vbs" by Stefan, 2019-05-18, v0.01
' Found at: https://ghisler.ch/board/viewtopic.php?p=355349#p355349
'// U S E R S E T T I N G S
'- go to your main folder for to create the new folders
'- have the text file with the list of folders to create
strFolderList = "Homines.txt"
'- save this vbs code as plain text file "Create Folders from List.vbs"
'- double click this VBS
'// T H E C O D E - - - - - - - - - - - - - - - - - -
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oTextStream = FSO.OpenTextFile(strFolderList,1)
strFolderList = oTextStream.ReadAll
oTextStream.Close
FldArray = split(strFolderList,",")
For FldIndex=0 To UBound(FldArray)
strFldName= trim(FldArray(FldIndex))
If strFldName <> "" Then
' DEBUG
'comment-out the next two lines if wanted:
MsgBox "Create : " & strFldName
If FldIndex=4 Then WScript.Quit
' /End DEBUG
'un-comment next line for to create the folders:
'If not (FSO.FolderExists(strFldName)) Then FSO.CreateFolder(strFldName)
End If
Next
'- - - - - - - - - - - - - - - - - - - - - - - - - - -
HTH?
>> below the same in PowerShell >
viewtopic.php?p=355561#p355561