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: Удаление в 50 каталогах лишних папок, с сохранением файлов 
Author Message
Flasher



PostPosted: Sat Jan 14, 2012 21:50    Post subject: Reply with quote

Darkenlightener
Code:
'====================================================
' Перемещение содержимого подкаталогов
' внутри выделенных папок на уровень вверх

' Параметры: %L
'====================================================
With CreateObject("Scripting.FileSystemObject")
Set TempFile = .OpenTextFile(WScript.Arguments(0), 1)
Do While Not TempFile.AtEndOfStream
   N = TempFile.ReadLine
   If .FolderExists(N) Then
      Set FF = .GetFolder(N)
      For Each Fd In FF.SubFolders
        For Each F In Fd.SubFolders
          If Not .FolderExists(N & .GetFileName(F)) Then F.Move N
        Next
        For Each F In Fd.Files
          If Not .FileExists(N & .GetFileName(F)) Then F.Move N
        Next
        If Fd.Size = 0 Then Fd.Delete
      Next
    End If
Loop
End With
TempFile.Close
Wscript.Quit


Last edited by Flasher on Mon Jan 16, 2012 14:37; edited 4 times in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group