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 

Можно ли сделать следующее...
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Total Commander Forum Index -> Общие вопросы printer-friendly view
View previous topic :: View next topic  
Author Message
Batya



Joined: 15 Dec 2004
Posts: 2229
Location: Москва, Россия

Post (Separately) Posted: Fri Jan 27, 2006 19:03    Post subject: Reply with quote

Code:
'========================================================================
' Сравнивание папок в панелях TC на имена и количество вложенных подпапок

' В параметрах вызова из TC должно быть прописано (2 пар. через пробел):
' %P %T
'========================================================================

Dim FSO, FoldAct, FoldPas, Fold, Fold1, objXL
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FoldAct = FSO.GetFolder(WScript.Arguments(0))
Set FoldPas = FSO.GetFolder(WScript.Arguments(1))
Set objXL   = WScript.CreateObject("Excel.Application")

objXL.Workbooks.Add

Dim i, j, C1, C2
i = 1
j = 1
C1 = 1
C2 = 4
objXL.Cells(i,C1).Value = FoldAct.Path
objXL.Cells(j,C2).Value = FoldPas.Path
For Each Fold in FoldAct.SubFolders
  If Not FSO.FolderExists(FoldPas.Path & "\" & Fold.Name) Then
    i = i + 1
    objXL.Cells(i,C1).Value = Fold.Name
  Elseif Fold.SubFolders.Count <> _
         FSO.GetFolder(FoldPas.Path & "\" & Fold.Name).SubFolders.Count Then
    i = i + 1
    objXL.Cells(i,C1).Value = Fold.Name
    For Each Fold1 in Fold.SubFolders
      i = i + 1
      objXL.Cells(i,C1+1).Value = Fold1.Name
    Next
    j = j + 1
    objXL.Cells(j,C2).Value = Fold.Name
    For Each Fold1 in FSO.GetFolder(FoldPas.Path & "\" & Fold.Name).SubFolders
      j = j + 1
      objXL.Cells(j,C2+1).Value = Fold1.Name
    Next
  End If
Next
For Each Fold in FoldPas.SubFolders
  If Not FSO.FolderExists(FoldAct.Path & "\" & Fold.Name) Then
    j = j + 1
    objXL.Cells(j,2).Value = Fold.Name
  End If
Next
objXL.Visible = True

Set FSO     = Nothing
Set objXL   = Nothing
Set Fold    = Nothing
Set FoldAct = Nothing
Set FoldPas = Nothing
Wscript.Quit()

В соседней колонке (мне показалось так понятней) показываются вложенные подпапки для папок, у которых количество вложенных подпапок не совпадает.
Я решил, что для уникальных папок подпапки отображать не имеет смысла. Или надо?
Back to top
View user's profile Send private message
Kent



Joined: 14 Dec 2004
Posts: 208

Post (Separately) Posted: Mon Dec 18, 2006 00:10    Post subject: Упаковать файлы во вложенных каталогах Reply with quote

Возникла задача упаковать rar-ом файлы во вложенных каталогах (несколько уровней) с таким условием, чтобы каждый упакованный файл оказался на том же месте.
То есть, имеется структура:
Code:
/dir0
   /dir1
      /dir4/
         file01.ext
         file02.ext
      /dir5/
         file03.ext
         file04.ext
   /dir2
      /dir6/
         file05.ext
         file06.ext
      /dir7/
         file07.ext
         file08.ext
   /dir3
      /dir8/
         file09.ext
         file10.ext
      /dir9/
         file11.ext
         file12.ext


Нужно получить:
Code:
/dir0
   /dir1
      /dir4/
         file01.rar
         file02.rar
      /dir5/
         file03.rar
         file04.rar
   /dir2
      /dir6/
         file05.rar
         file06.rar
      /dir7/
         file07.rar
         file08.rar
   /dir3
      /dir8/
         file09.rar
         file10.rar
      /dir9/
         file11.rar
         file12.rar

Как это можно реализовать?
Back to top
View user's profile Send private message
Parcan



Joined: 15 Dec 2004
Posts: 399
Location: Russian

Post (Separately) Posted: Mon Dec 18, 2006 14:40    Post subject: Reply with quote

сначала вопользоваться архиваторным плагином TreeCopyPlus.wcx (копирует файлы с полными путями) - получишь в любом месте диска такую структуру для выбранных файлов, а потом уже ее и заархивировать.
Back to top
View user's profile Send private message
Kent



Joined: 14 Dec 2004
Posts: 208

Post (Separately) Posted: Mon Dec 18, 2006 18:39    Post subject: Reply with quote

Копировать не нужно. Нужно упаковать все файлы, но не в один архив, а каждый файл в свой.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Общие вопросы All times are GMT + 4 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group