Login | |
|
 |
Script with data of modification - 7/28/2008 8:28:47 AM
|
|
 |
|
| |
raffe
Posts: 2
Score: 0
Joined: 7/27/2008
Status: offline
|
Hi, I’ve got problem with script. It copies folders with text in file. But I need copy folders bigger than 0kb with given date of modification. Thank you so much, I wait for your answer. Dim Fso,Tso,Folder,Files,FName,FolderZ,FolderD,Item,String,Tekst FolderZ="C:\scripts\data" FolderD="C:\scripts\copy\" String="folder folder" Set RegExp=CreateObject("VBScript.RegExp") Set Fso=CreateObject("Scripting.FileSystemObject") Set Folder=Fso.GetFolder(FolderZ) Set Files=Folder.Files RegExp.Global=True RegExp.IgnoreCase=True For Each Item in Files RegExp.Pattern="\.\d{3}$" If RegExp.Test(Right(Item,4)) Then ' dla Unicode -> Set Tso=Fso.OpenTextFile(Item,1,,-1) Set Tso=Fso.OpenTextFile(Item,1) Tekst=Tso.ReadAll RegExp.Pattern=String If RegExp.Test(Tekst) Then FName=Right(Item,Len(Item)-InStrRev(Item,"\")) Fso.CopyFile Item,FolderD&"\"&FName,-1 End If End If Next Set RegExp=Nothing Set Fso=Nothing Set Folder=Nothing Set Files=Nothing Set Tso=Nothing
|
|
| |
|
|
|
 |
RE: Script with data of modification - 7/28/2008 8:45:32 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
I have a problem, also. I like to post questions in the wrong forums before reading the posting rules.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: Script with data of modification - 7/28/2008 1:30:10 PM
|
|
 |
|
| |
dm_4ever
Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
I moved the post just for you DS raffe, I don't see you script checking any dates....have you looked at the documentation for the FileSystemObject to see how to retrieve the last modified date?
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|