Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Копирование базовых имён выбранных объектов в буфер обмена 
Author Message
Flasher



PostPosted: Wed May 02, 2018 01:20    Post subject: Reply with quote

Code:
'==================== 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

_________________
Автору сборки TC Image (Andrey_A) настоятельно рекомендуется не распространять на иных ресурсах любую предоставленную мной где-либо техническую информацию по автоматизации и оптимизации в работе с ТС и системой.


Last edited by Flasher on Wed May 23, 2018 19:34; edited 3 times in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group