user1938464
user1938464

Reputation: 127

Update batch file version

Let's say I have a batch file called somefile_old.bat. Online there is a new version called somefile_new.bat. How do I check if there is a new version online from somefile_old.bat, and if there is, download it?

Upvotes: 1

Views: 244

Answers (2)

npocmaka
npocmaka

Reputation: 57242

with pure batch you can check if the version is newer only after you donload the file and compare both (you can use bitsadmin or beter wget ) . As it is a batch file it will no take long time and will be may be the fastest way..

Upvotes: 1

hd1
hd1

Reputation: 34657

  1. Put a hash of somefile_new.bat somewhere.
  2. Calculate the hash of somefile_old.bat.
  3. Compare the two.
  4. If they're not the same, then download the new version and deal with the old one.

Upvotes: 2

Related Questions