How to Copy files to multiple servers
Hello,
Can somebody please help me , I have never programmed a VBScript so now i want to create one in which I want to copy a file to multiple servers on the network. I think these servers should be listed in the file. but I do not know how to write the script , can somebody please write this script , thank you for your help
Re: How to Copy files to multiple servers
Check this Code
Quote:
Dim FSO
Set WshShell = WScript.CreateObject ( "WScript.Shell")
Set FSO = CreateObject ( "Scripting.FileSystemObject")
strMachine = "D-N001"
Set objFile = CreateObject (Scripting.FileSystemObject)
Set MyFile = obj.OpenTextFile ( "D:\batch\A.VBS", 8, true)
echo
FSO.CopyFile "D:\batch\A.VBS", "\\strMachine\d$\batch\A.VBS", true
echo
WScript.Close
WScript.Quit
Re: How to Copy files to multiple servers
Microsoft has an unsupported tool Called Synctoy that can syncronise files across media locations. It was originaly created for managing photos but works well with all types of media and files.
SyncToy 2.0 for Windows is available as a free download from the Microsoft Download Center. The easy to use, customizable application helps you copy, move, rename, and delete files between folders and computers.
There are files from all kinds of sources that we want to store and manage. Files are created by our digital cameras, e-mail, cell phones, portable media players, camcorders, PDAs, and laptops. Increasingly, computer users are using different folders, drives, and even different computers (such as a laptop and a desktop) to store, manage, retrieve, and view files. Yet managing hundreds or thousands of files is still largely a manual operation. In some cases it is necessary to regularly get copies of files from another location to add to primary location; in other cases there is a need to keep two storage locations exactly in sync. Some users manage files manually, dragging and dropping from one place to another and keeping track of whether the locations are synchronized in their heads. Other users may use two or more applications to provide this functionality.
Re: How to Copy files to multiple servers
robocopy, or "Robust File Copy", is a command-line directory replication command. It was available as part of the Windows Resource Kit, and introduced as a standard feature of Windows Vista and Windows Server 2008.
Robocopy is designed for reliable mirroring of directories or directory trees. It has features to ensure all NTFS attributes and properties are copied, and includes additional restart code for network connections subject to disruption.