Ogmike
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору вот на данный момент полный скрипт: Код: Option explicit Dim fsObj,fileList,file,name Dim folder,folderList,subFolder,newFolder Dim today Dim destFolderPath destFolderPath = "ziel\" const folderspec = "C:\Documents and Settings\mikapla\Desktop\ino test\" call start_Backup() '########################################################### sub start_Backup() Set fsObj = CreateObject("Scripting.FileSystemObject") Set folder = fsObj.GetFolder(folderspec) Set folderList = folder.SubFolders Set fileList = folder.Files today = WeekDay(Now) today = checkToday(today) destFolderPath = destFolderPath & today If Not fsObj.FolderExists(destFolderPath) Then Set newFolder = fsObj.CreateFolder(destFolderPath) End If for each subFolder in folderList name = subFolder.Name if check(name) then fsObj.CopyFolder subFolder, destFolderPath end if next for each file in fileList name = file.Name if check(name) then fsObj.CopyFile file, destFolderPath end if next end sub '########################################################### '########################################################### function check(name) dim x x = InStr(1,name,"Mif",1) if x = 1 then check = true end if end function '########################################################### '########################################################### function checkToday(today) Select Case today Case "2" checkToday = "Montag" Case "3" checkToday = "Dienstag" Case "4" checkToday = "Mittwoch" Case "5" checkToday = "Donnerstag" Case "6" checkToday = "Freitag" End Select end function '########################################################### | Цитата: вероятно в destFolderPath надо прописывать полный путь от имени диска, а не относительный. | я уже и так и так пробовал, никакой разницы p.s. это мой первый на VBScript, может это можно сделать и лучше |