开发者

Change a files md5 number using a batch file

I'm a really newbie, so sorry if the title isn't grammatically c开发者_开发问答orrect :p Anyway...

Can I change a files md5 number using a batch file


It's not clear at all which are your intents but a MD5 is associated with a set of bytes. You cannot change it without changing the bytes and recalculating it. This operation is one-way in the sense that you have your data, you use it to calc the MD5, you keep MD5 around with your file so that you can check the integrity whenever you need it.

This apporach requires the MD5 to be correct a not to be modified..


An MD5 checksum is calculated from the contents of the file. The only way you could change this using a batch file, would be to write a batch file which would modify the file.

If the file is text, you could simply echo some new contents to the end:

echo something >> $filename

If, however, the file is binary, this will lead to corruption.

If your question actually referred to the creation of MD5 checksums, you can obtain FCIV from Microsoft and use this within your batch: http://support.microsoft.com/kb/841290

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜