Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Need script to copy file to multiple workstations accross network

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Need script to copy file to multiple workstations accross network
  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 >>
 Need script to copy file to multiple workstations accro... - 10/1/2008 2:46:58 AM   
  ccortez

 

Posts: 4
Score: 0
Joined: 10/1/2008
Status: offline
I apologize if this is not the correct place to post, first time posting for me.

I found a script on http://www.microsoft.com/technet/scriptcenter/resources/qanda/may07/hey0515.mspx that seemed like it might work but when I edited to apply to my enviorment I get error message.

Script: c:\copy.vbs
Line: 10
Char: 5
Error: Path not found
Code:800A004C
Source: Microsoft VBScript runtime error

This is the vbs file that i modified

Const ForReading = 1
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Computers.txt")
Do Until objFile.AtEndOfStream
   strComputer = objFile.ReadLine
   strRemoteFile = "\\" & strComputer & "C:\windows\DCAS_Wallpaper13_1920x1200_4.jpg"
   objFSO.CopyFile "C:\windows\DCAS_Wallpaper13_1920x1200_4.jpg", strRemoteFile, OverwriteExisting
Loop


If there is an easier way to accomplish this or any help in correcting above script I will greatly appreciate.

Thanks.
 
 
Post #: 1
 
 RE: Need script to copy file to multiple workstations a... - 10/1/2008 4:48:53 AM   
  Country73


Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
Replace
strRemoteFile = "\\" & strComputer & "C:\windows\DCAS_Wallpaper13_1920x1200_4.jpg"

With
strRemoteFile = "\\" & strComputer & "\c$\windows\DCAS_Wallpaper13_1920x1200_4.jpg"

That should take care of it.

(in reply to ccortez)
 
 
Post #: 2
 
 RE: Need script to copy file to multiple workstations a... - 10/1/2008 5:13:52 AM   
  ccortez

 

Posts: 4
Score: 0
Joined: 10/1/2008
Status: offline
I made change you recommended but still got same error. 
I downloaded a piece of software call Remote Batch Copy and that seems to be doing the trick for me.

Thank you very much for your reply.

(in reply to ccortez)
 
 
Post #: 3
 
 
 
  

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 >> Need script to copy file to multiple workstations accross network 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