Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Script with data of modification

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62870
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Script with data of modification
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 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
 
 
Post #: 1
 
 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

(in reply to raffe)
 
 
Post #: 2
 
 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

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 3
 
 RE: Script with data of modification - 7/28/2008 5:19:35 PM   
  raffe

 

Posts: 2
Score: 0
Joined: 7/27/2008
Status: offline
Hello,
This script copy file only bigger than 0kb, i don't know why......

(in reply to dm_4ever)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Script with data of modification Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts