Discussion Locked

Auto update client computer files

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to write a Windows script or batch file, or something similar, to include in the boot-up process on all my client computers. I want to automatically update various files (particular files) on each client machine upon boot-up whenever the master files, which reside on a server, are changed. I suppose to be more accurate, I want the client files updated whenever they are different from the master files. I save these master files on a server, change them on occasion, and currently have to update each client computer manually and individually. Moreover, a user might change these files on his own (the ones on his computer, not the master), even though that's a major no-no. So I want my master files to rule, regardless of the date that might appear on the user's files. However, I don't want to simply overwrite the files upon every boot-up, as there are hundreds, maybe even over a thousand files. So I want to overwrite only the user files that are different than the master files.

I'm just starting to look into writing a script or batch file for this, but does anyone have some proven code or, perhaps, another idea to accomplish the same thing? (Windows 2000 Professional and Server, by the way.)

Later...

14 replies

by maxwell edison

Thanks for the suggestion. I was looking for some free code, but your suggestion looks like something that could come in handy some day.

by darinr845

It sounds like you're trying to accomplish what Microsoft is now doing with Windows XP and the .dlls and systems files. They have a setup so that even if the user deletes the file it automatically gets re-written. There was also some discussion via their discussion groups of automating this application to not only check itself but to check a central repository, either before it logs off or when a login occurs. The plan was to have a master copy in a repository that was updateable from administration yet to the end user it was transparent even if they messed with the file deliberately or accidentally. There was mention of several other respository products that do something similiar, but I have no exp with these.try querying knowledge base on these various topics.

by joseph moore

Howdy Max.
I looked at the options for ROBOCOPY.EXE from the Resource Kit. There was this line in the help for it:

/XC | /XN | /XO : eXclude Changed | Newer | Older files.

So, you could set up a BAT file using ROBOCOPY, and have it exclude Older files (/XO switch). I haven't tested this one yet, but it might do what you want it to do.
When a file changes in the source directory, in theory this switch would then allow the new file to be copied to the destination, while not copying the older unchanged files.

What do you think?

by maxwell edison

Joseph, Thanks for the suggestion. By the way, do you have a minute for a VPN question? Send me an email at maxwell_t_edison@yahoo.com if you do. I had something rather interesting happen, and you just may know the solution. If not, you'd be interested in hearing about it. (If you have a solution, I'll pay you a bunch of points for your trouble :~)........)

by voldar

Hello Max,

Here what I sugest you:
use a bat file in a GPO policy, at the machine level, that will create each time a user starts his computer or restart it, the file will be copied over the existing one on the client computer.
I had also implemented this, and I used a .bat file containing the following line:
copy \\server\retea\test.doc "%userprofile%"\desktop
or wherever you want to copy the file (in my case was on the desktop).

by voldar

And now, let's correct my English :)

"Here IS what I suggest .."
"starts .. or restarts it"
"the file"->"a file which"
"or wherever"->"You can coppy it wherever .."

by voldar

And ouch ... reading again your post ... I find out that is not what you were looking for. Max, this is going to be longer than you expect if you like a script to check every file from the client computer to its correspondent on the server, and decide wether or not to replace it. I think the time will be as long as you'd copy all the files every time. But this is just a thought. I will try to check if I can help with a solution.

by maxwell edison

Thanks for the suggestion. You're right. Comparing to the user's file is the challenge with a .bat file. I already have a good .bat file based on a basic xcopy with some switches that runs via a task in Windows scheduler, but I got some good ideas with these answers. Thanks for contributing.

This discussion is closed to new replies.