'==================== VBS ==================
' Скопировать выбранные имена без расширений
' Параметры: %Z%WF
' Ключ /n оставляет "\" на конце имён папок
'===========================================
If WSH.Arguments.Count Then List = WSH.Arguments(0) Else WSH.Quit
Ex = "]+$" : Set FSO = CreateObject("Scripting.FileSystemObject")
If WSH.Arguments.Named.Exists("n") Then Ex = "\\]+(?=\\|$)"
With New RegExp
.Global = True : .MultiLine = True : .Pattern = "\n$|\.[^.\n" & Ex
All = .Replace(FSO.OpenTextFile(List,,,-1).ReadAll, "")
End With
With CreateObject("SAPI.SpFileStream")
.Format.Type = 1 : .Open List, 3 : .Write All : .Close
End With
CreateObject("WScript.Shell").Run "%ComSpec% /c clip<" & List, 0 |