Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Urgent Mulitple File Copy Issue...

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Urgent Mulitple File Copy Issue...
  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 >>
 Urgent Mulitple File Copy Issue... - 7/8/2008 12:43:46 PM   
  kmarty009

 

Posts: 64
Score: 0
Joined: 5/21/2004
From: USA
Status: offline
I need serious help here....  I have a list of files that did not get copied over for batch processing.  I used windiff to tell which files were missing.  Not that I have 680 files to copy I need to get this done ASAP.  So I wrote a script to get the files listed in a text file.  However, my script errors on Line #7 about wrong number of arguments or invaild property assignment: 'fso.CopyFile'.  Can somebody please help me?  I need to copy the files listed in a text file from one server to another, but somewhere my code is bad and I cannot get it working.  Thanks so much in advance.... 

Set fso = CreateObject("Scripting.FileSystemObject")
src = "\\server1\Library\Product\Ring\6000\panel\Ring_Designer\To_Be_Cataloged\"
Set inFile = Fso.OpenTextFile("xpring03_missing_6000-tbc.txt", 1)
Do Until inFile.AtEndOfStream
temp = inFile.ReadLine
dest = "\\server2\c$\panels\6000_not_batched\to_be_cataloged\"
fso.CopyFile " & temp & ", src, dest, true
Loop

_____________________________

KirkM.
 
 
Post #: 1
 
 RE: Urgent Mulitple File Copy Issue... - 7/8/2008 2:58:39 PM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Both of these *should* work for you, assuming that the file list is strictly the filenames, and no directory information.

the second coe snippet should quickly examine each file to see if it exists in the destination.
If it doesn't it will copy it there.
Does the same thing as the first, but you don't have to generate a listfile every time.

you might also want to look into downloading and using synctoy by Microsoft.
It is a freeware directory synchro tool.  Very good, very easy.

Good luck!


      

      


_____________________________

"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 kmarty009)
 
 
Post #: 2
 
 RE: Urgent Mulitple File Copy Issue... - 7/9/2008 12:19:06 AM   
  kmarty009

 

Posts: 64
Score: 0
Joined: 5/21/2004
From: USA
Status: offline
Thanks - Digital Skream.  I have one question though I copied the first code snipet but I get and error on line #7, 10 that states :Microsoft VBScript runtime error: File not found"  Which File?  I am supposed to copy both codes?




Set fso = CreateObject("Scripting.FileSystemObject")
src = "\\egnsw2kfp1\Library\Product\Ring\6000\panel\Ring_Designer\To_Be_Cataloged\"
Set inFile = Fso.OpenTextFile("e:\kirk\missing\6000\xpring03_missing_6000-tbc.txt", 1)
   Do Until inFile.AtEndOfStream
        temp = inFile.ReadLine
        dest = "\\egnsxpring03\c$\panels\6000_not_batched\to_be_cataloged\"
        fso.CopyFile src & temp, dest, true
   Loop

_____________________________

KirkM.

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 3
 
 RE: Urgent Mulitple File Copy Issue... - 7/9/2008 12:31:18 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: online
Try using wscript.echo to make sure the file name is valid:

Set fso = CreateObject("Scripting.FileSystemObject")
src = "\\egnsw2kfp1\Library\Product\Ring\6000\panel\Ring_Designer\To_Be_Cataloged\"
Set inFile = Fso.OpenTextFile("e:\kirk\missing\6000\xpring03_missing_6000-tbc.txt", 1)
   Do Until inFile.AtEndOfStream
        temp = inFile.ReadLine
        dest = "\\egnsxpring03\c$\panels\6000_not_batched\to_be_cataloged\"
       WScript.Echo src & temp
        fso.CopyFile src & temp, dest, true
   Loop

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kmarty009)
 
 
Post #: 4
 
 RE: Urgent Mulitple File Copy Issue... - 7/9/2008 12:40:06 AM   
  kmarty009

 

Posts: 64
Score: 0
Joined: 5/21/2004
From: USA
Status: offline
Actually I got the second code to work,  But how is it copying the missing files without referenecing the text list?  Forgive my ignorance here, but is it looking to reference a text file in the directory where the script?  I need this script to copy only the files that got missed which I placed in a text file.  I am just curious to how script #2 works!

Also what is the possible problem with script code #1?

_____________________________

KirkM.

(in reply to kmarty009)
 
 
Post #: 5
 
 RE: Urgent Mulitple File Copy Issue... - 7/9/2008 12:55:51 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: online
The second script just looks at every file in the source folder. For each file it checks to see if the file exists in the destination folder. If it doesn't exist then it copies it.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kmarty009)
 
 
Post #: 6
 
 RE: Urgent Mulitple File Copy Issue... - 7/9/2008 1:08:15 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
Depending on how "Urgent" this is..... I would download and use Beyond Compare from Scooter Software.
Then fix the script for future copies

_____________________________

Rischip
Author of - The Grim Linker

(in reply to kmarty009)
 
 
Post #: 7
 
 RE: Urgent Mulitple File Copy Issue... - 7/9/2008 9:19:48 AM   
  kmarty009

 

Posts: 64
Score: 0
Joined: 5/21/2004
From: USA
Status: offline
Thanks ebGreen that worked!

_____________________________

KirkM.

(in reply to kmarty009)
 
 
Post #: 8
 
 
 
  

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 >> Urgent Mulitple File Copy Issue... 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