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: Mon Apr 20, 2015 03:30    Post subject: Reply with quote

Code:
'=======================================
' Создать из выбранного список элементов
' по шаблону {родитель}{элемент}

' Параметры %WL "<путь назначения>"
'=======================================
With WScript.Arguments
  If .Count = 0 Then WScript.Quit
  L = .Item(0) : P = .Item(1)
End With
With CreateObject("Scripting.FileSystemObject")
  Path = .BuildPath(P, "\") : Set L = .OpenTextFile(L,,,-1)
  Do : F = L.ReadLine
    S = S & vbNewLine & "{" & .GetFileName(._
    GetParentFolderName(F)) & "}{" & .GetFileName(F) & "}"
  Loop Until L.AtEndOfStream
  BN = "ParentNameList" : Ext = ".txt" : i = 0 : F = BN & Ext
  While (.FileExists(Path & FN) OR .FolderExists(Path & F))
  i = i + 1 : F = BN & " (" & i & ")" & Ext : Wend : Name = Path & F
  .CreateTextFile(Path & F, 1, True).Write Mid(S, 3)
End With

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


Powered by phpBB © 2001, 2005 phpBB Group