Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Copy Files Using VbScript

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Copy Files Using VbScript
  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 >>
 Copy Files Using VbScript - 10/30/2007 6:43:03 PM   
  mcseramana

 

Posts: 19
Score: 0
Joined: 7/18/2007
Status: offline
Hi All, i AlSo similar question like below But my condtion is copy files from remote system how to local system how to do this one please help me any one.......

Hey All,

Look like am not getting right logic to strart the below scenario


Okie here we go...

I have Folder A and Floder B,assume Folder A getting new files every one hour or may not get anything new.

i suppose to write a script to copy Folder A files to Folder B

Condtion 1:

The script run every one hour to copy files in Folder A to Folder B.

Condition2:

Every time script run it find the new file and copy to folder B.

For example.

Assume the script is running at 10 Am

Folder A got three files at the time  File1,file 2,File3.

so the script just copy all three files to Folder B.

on the next run at 11 Am

Folder A got anothe two new files File 4 and file 5.

Now Folder A have 5 files ( File1,file 2,File3,files File 4 and file 5.)

on this run (at 11Am) the script should copy only File 4 and File 5 to Folder B.


I know this is possible to get the time stamp of the files and copy to the folder but still some thing i feel not 100% right.

I saw lot of examples in this forum and one particular almost nearer to my scenario answered by EBGREEN
 
 
Post #: 1
 
 RE: Copy Files Using VbScript - 10/30/2007 11:02:56 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
This should help, maybe someone can correct what I have done wrong


      

(in reply to mcseramana)
 
 
Post #: 2
 
 RE: Copy Files Using VbScript - 10/31/2007 12:43:53 AM   
  mcseramana

 

Posts: 19
Score: 0
Joined: 7/18/2007
Status: offline
I want copy files form network system mean my system some other place to local system, so have connect to network how can use this with network i am asking that please help me anyone.....


Thank you

(in reply to mcseramana)
 
 
Post #: 3
 
 RE: Copy Files Using VbScript - 10/31/2007 2:08:22 AM   
  ehvbs

 

Posts: 2223
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi mcseramana,

try this:


      

Set sSrcDir and sDstDir according to your needs/circumstances.

Use the sheduler of your system to run the script once in each hour.

Consider using robocopy or xcopy instead of such a script.

Good luck!

ehvbs

(in reply to mcseramana)
 
 
Post #: 4
 
 RE: Copy Files Using VbScript - 10/31/2007 5:28:48 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
ehvbs the way I see it is your script will copy all files to the destination
He wants just the files that have been add in the last hour to be copied.

My script seems to work but haven't had time to test it in full.

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: Copy Files Using VbScript - 10/31/2007 8:56:12 PM   
  mcseramana

 

Posts: 19
Score: 0
Joined: 7/18/2007
Status: offline
Thank's for sending Its working fine but its copying All files,  But not copying recently added files and update files... why? please tell me how to do that one , i want recently updated and recently add files only copying ...



Thank you

(in reply to gdewrance)
 
 
Post #: 6
 
 RE: Copy Files Using VbScript - 10/31/2007 11:53:37 PM   
  mcseramana

 

Posts: 19
Score: 0
Joined: 7/18/2007
Status: offline
Thank you gdewrance  for u r help....

this code is work for single directory only not subdirectory...

Thanks'

(in reply to mcseramana)
 
 
Post #: 7
 
 RE: Copy Files Using VbScript - 10/31/2007 11:53:47 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
Revisited and I saw my error finally


      

(in reply to mcseramana)
 
 
Post #: 8
 
 RE: Copy Files Using VbScript - 11/1/2007 5:12:14 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
quote:

this code is work for single directory only not subdirectory...

Maybe I misread something but I never saw subdirectory mentioned till now.
My mind reading ability is surely diminishing as I get older, or maybe it's my kids driving me mad.

(in reply to mcseramana)
 
 
Post #: 9
 
 RE: Copy Files Using VbScript - 11/1/2007 9:18:37 PM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
This is all a bit De ja Vue http://www.visualbasicscript.com/m_43169/tm.htm

(in reply to gdewrance)
 
 
Post #: 10
 
 
 
  

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 >> Copy Files Using VbScript 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