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
Batya



PostPosted: Thu Feb 10, 2005 14:48    Post subject: Reply with quote

mike
Создай файлик *.vbs. Повесь его на кнопку. В параметрах пропиши %L. Код файла:
Code:
Dim FSO, TempFile, SelFile, WriteFile, OpenFile
Set FSO = CreateObject("Scripting.FileSystemObject")

ForReading   = 1 'Open a file for reading only. You can't write to this file
ForWriting   = 2 'Open a file for writing
ForAppending = 8 'Open a file and write to the end of the file

Set TempFile = FSO.OpenTextFile(WScript.Arguments(0), ForReading)

FileAll = InputBox("Введите имя файла", "Копирование содержимого", "all.txt")
if Len(FileAll) = 0 then
  A1 = MsgBox("Не задано имя файла!", vbOKOnly + vbExclamation, "Копирование содержимого")
  WScript.Quit(1)
End if

Set WriteFile = FSO.OpenTextFile(FileAll, ForAppending, True)
Do While Not TempFile.AtEndOfStream
  Set SelFile = FSO.GetFile(TempFile.ReadLine)
  Set OpenFile = FSO.OpenTextFile(SelFile, ForReading)
  WriteFile.Write OpenFile.ReadAll
  WriteFile.Write chr(13)
Loop

WScript.Quit
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group