|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Distribute Files from admin machine
Hi everybody,
I'm a newbie with scripting. Does somebody have a script that i can run from an Admin Workstation (because of the credentials) that has the following features: - Script has to distribute a file accross all Client computers on the network (not the servers) - Script has to copy the file in a specific location, if the location isn't there than check for another location. - When the script has copied the file to a machine it may not run again for that machine only when the file/registry key isn't there. I hope some one can help me. Greetzz, remco Here is a simple way of doing this:
1: Create a text file with all the computer names in it that you want to transfer the file to such as this -->8 copy below here Computer1 Computer2 Computer3 -->8 copy abover here 2: Here is the script, run it from the same directory that the text file with the computer names is in -->8 copy below here @ECHO OFF FOR /F %%a in (computers.txt) do ( If exist \\%%a\C$\Location2 SET TARGET=\\%%a\C$\Location2 If exist \\%%a\C$\Location1 SET TARGET=\\%%a\C$\Location1 IF NOT EXIST %LOCATION%\file1.txt COPY C:\file1.txt %TARGET% ) -->8copy above here I hope you can work out how this works. Cheers, Jeremy. Show quote "Remco" <Re***@discussions.microsoft.com> wrote in message news:0F6744AE-3186-49CA-8168-50A5620B0FD2@microsoft.com... > Hi everybody, > > I'm a newbie with scripting. > Does somebody have a script that i can run from an Admin Workstation > (because of the credentials) that has the following features: > > - Script has to distribute a file accross all Client computers on the > network (not the servers) > - Script has to copy the file in a specific location, if the location > isn't > there than check for another location. > - When the script has copied the file to a machine it may not run again > for > that machine only when the file/registry key isn't there. > > I hope some one can help me. > > Greetzz, > remco There are a few details missing...
"Remco" <Re***@discussions.microsoft.com> wrote in message put in C:\location1, but if that folder does not exist put in C:\location2? news:0F6744AE-3186-49CA-8168-50A5620B0FD2@microsoft.com... > Hi everybody, > > I'm a newbie with scripting. > Does somebody have a script that i can run from an Admin Workstation > (because of the credentials) that has the following features: > > - Script has to distribute a file accross all Client computers on the > network (not the servers) > - Script has to copy the file in a specific location, if the location > isn't > there than check for another location. but what if that folder does not exist either? I have such scripts, but they either use a target folder that must always exist, or they create it as needed. > - When the script has copied the file to a machine it may not run again isn't there on what machine, your admin workstation or the client?> for > that machine only when the file/registry key isn't there. Our scripts will typically do the copy in such a way that the copy will be done only if the file being copied is newer. If you keep track of which systems have received the file, that does not necessarily mean that the file is still there. as to workstations rather than servers, we base this on the naming convention, and use only those names produced by the NET VIEW command that have the workstation prefix associated with our site. This will, of course, only affect those machines that have been on for the last 10 minutes or so. /Al |
|||||||||||||||||||||||