Answer the question
In order to leave comments, you need to log in
How to compare files via command line?
Hello
I need to update a program (exe file) for a group of users.
At the moment, each of them has a bat file, which:
1) Unloads our program by name from the list of processes
2) Copies the actual program file from the server
3) Runs the copied program locally
Need
1) Allow users to run the program several times through a single bat file
I think so, the bat file should check if an update is needed, and, if necessary, only then close the running program and copy the new one. And in any case, run the program.
Unfortunately, the fc file1.exe file2.exe /b command takes a long time (not instantaneous) on my computer. Why - I can not say, because I encounter it for the first time. But anyway, when I manually replace a file, Windows instantly determines if there is a difference in the files or if they are the same.
Perhaps the problem is solved in a completely different way.
Thanks
Answer the question
In order to leave comments, you need to log in
Add version output to the program at startup with a parameter. --version
, for example
Keep information about the newest version on the server. It might even be a txt file.
When running a bat file, look at the current version, compare it with the version on the server, and only update if necessary.
You can calculate md5/ sha1
and compare hashes:
https://support.microsoft.com/en-us/help/889768/ho...
the files really changed and went on computers approximately close, at least up to minutes)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question