[Индекс] | [Посмотреть ветку] | [Настройки] | [DVDSpecial.ru] |
нолики впереди пофиксил: (+)
Автор:
Дата: 17.05.11, @15:14
Option Explicit Dim list, s, file, extPos, spcPos, tnumPos If wscript.arguments.count <> 1 Then msgbox "Использование скрипта: " & Wscript.ScriptName & " СписокФайлов.txt" & vblf & _ "Или тащите мышкой СписокФайлов.txt и бросайте на иконку скрипта." wscript.quit End if Set list = CreateObject("Scripting.Dictionary") With CreateObject("Scripting.FileSystemObject") For Each s In Split(.OpenTextFile(wscript.arguments(0)).ReadAll, vbCrLf) tnumPos = InStr(s,".") If tnumPos < 3 Then s = "0" & s End If list.Add Left(s, 3), s Next For Each file In .GetFolder(.GetParentFolderName(wscript.arguments(0))).Files extPos = InStrRev(file.Name, ".") 'позиция точки перед расширением spcPos = InStrRev(file.Name, " ", extPos - 1) s = Mid(file.Name, spcPos + 1, extPos - spcPos) If list.Exists(s) Then file.Name = list(s) & Mid(file.Name, extPos) list.Remove s End If Next End With |
Сообщения в ветке