|
Answer» Hi
I NEED to create a batch file to copy files from a specific FOLDER on a server to each host computer. The batch file can be stored in a shared folder on the network, or can reside on each host computer (which are about 400 users).
I'm very new to batch files
Please help
Thanks MeeeMzHi, I just thought I'd stop by and say "HI"!
One thing that's occurred to me is that you're talking about doing 'something' with files on (obviously) an NTFS drive from a DOS program and also doing it over a network. Am I right so far?
DOS can't even see an NTFS drive. I know DOS has 'grown up' a lot since the days when I had to learn it, to run my IBM XT Clone with DOS 2.0 on it.
Maybe someone with experience with the "New DOS" can tell you how to do what you outlined. I'm out of my element here. Sorry.
Good Luck, The Shadow I am also fairly new to batch files, but this is the sort I use at work for copying images to new destinations
copy "full path to file" "full path to destination"
i.e
copy "c:\test files\0001.txt" "\\destinationpc1\c\test files\" copy "c:\test files\0001.txt" "\\destinationpc2\c\test files\" copy "c:\test files\0002.txt" "\\destinationpc1\c\test files\" copy "c:\test files\0002.txt" "\\destinationpc2\c\test files\" copy "c:\test files\0003.txt" "\\destinationpc1\c\test files\" copy "c:\test files\0003.txt" "\\destinationpc2\c\test files\"
I don't know if you can put more than one destination per line, as I don't copy to more than 1 PC anyway. Of course the destination folder needs to excist in the 1st place. Hi
metallithrax's suggestion will PUSH files out from the server.
A simpler solution is to replace copy "c:\test files\0001.txt" "\\destinationpc1\c\test files\" with copy "c:\test files\*.*" "\\destinationpc1\c\test files\"
That avoids the need to individually copy each and every specific file. If *.* copies additional files which are not required, then copy from a different folder that has been specifically CREATED to hold whatever files need to be deployed.
In addition you may need to keep your resume up to date in anticipation of a sudden job search when the C.E.O. or Financial Director finds his files are out of date. Just because you are not responsible for maintaining the Network does not mean you will escape blame.
You may need to add more complexity so that for each destination you :- 1) test whether or not it is on-line BEFORE you push files at it; 2) produce an "exception report" file listing any offline or other problem. Also for each destination, either immediately or as a subsequent action 3) compare the destination files with the originals that you pushed out, and 4) produce an "exception report" file listing any problems.
The reason for a delay before stages 3 and 4 is to allow for Anti-virus and Firewall etc problems. If they don't like something they may stop it before it gets to its destination, OR there might be a late reaction to a "virus" and perhaps it might take a while to quarantine.
If you get any exception reports, you may be able to take corrective action and try again, otherwise you can email the report to whoever can fix it, thus avoiding a visitation from management and making you bullet proof - or at least finger-pointing proof.
You will of course get a lot of grief from the Network Maintenance engineers if your exception reports keep on SENDING them to fix an offline problem at a P.C. that has been switched off for a few weeks pregnancy leave !!!
You will find life easier if you can avoid any problems with the network. All you have to do then is to PULL files into each P.C. from the server. e.g. Each P.C. upon start-up and or User log-on, could run copy "\\destinationpc1\c\test files\*.*" "c:\test files\" or whatever is relevant to your network.
By using the PULL solution it is simple to add a warning to the user if the Network has failed to download from the server, and he can immediately phone the Network maintenance engineers - and for the ladies you could also advise to PHONE NOT EMAIL any network problems !!!!
Regards Alan
|