Generate CRC-32 Checksum with batch file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Adrianvdh
Posts: 177
Joined: 16 May 2013 13:00

Generate CRC-32 Checksum with batch file

#1 Post by Adrianvdh » 12 Jun 2014 15:02

Hey everyone, sorry I have been away for a while, been busy with school and all, but...

I recently looks at an old batch file I created for a YouTube video to register a OCX for the system (MSCOMCTL.OCX)
Well my code is efficient, but I would like to make it more.. Well I have a function (Already) to check if the file exists on the System32
directory and if it finds this file (That OCX ) I want it to check if it is the original file and not corrupted or anything.. So therefore I would
need to compare the found file's CRC-32 Checksum to the original file.

Does anyone have an idea of a function that can do this without using any 3rd EXE party app? Just native batch please :D.

einstein1969
Expert
Posts: 960
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: Generate CRC-32 Checksum with batch file

#2 Post by einstein1969 » 12 Jun 2014 15:08

Adrianvdh wrote:Hey everyone, sorry I have been away for a while, been busy with school and all, but...

I recently looks at an old batch file I created for a YouTube video to register a OCX for the system (MSCOMCTL.OCX)
Well my code is efficient, but I would like to make it more.. Well I have a function (Already) to check if the file exists on the System32
directory and if it finds this file (That OCX ) I want it to check if it is the original file and not corrupted or anything.. So therefore I would
need to compare the found file's CRC-32 Checksum to the original file.

Does anyone have an idea of a function that can do this without using any 3rd EXE party app? Just native batch please :D.


I have done crc32 check. But there is also md5 in this forum. try search.

einstein1969

Adrianvdh
Posts: 177
Joined: 16 May 2013 13:00

Re: Generate CRC-32 Checksum with batch file

#3 Post by Adrianvdh » 12 Jun 2014 15:19

Which would be better to use, the crc32 or md5 algorithm?

einstein1969
Expert
Posts: 960
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: Generate CRC-32 Checksum with batch file

#4 Post by einstein1969 » 12 Jun 2014 15:23

Adrianvdh wrote:Which would be better to use, the crc32 or md5 algorithm?


Md5 is better. But read the initial posts of this discussion for better info.

einstein1969


Adrianvdh
Posts: 177
Joined: 16 May 2013 13:00

Re: Generate CRC-32 Checksum with batch file

#6 Post by Adrianvdh » 14 Jun 2014 04:20

Well then shouldn't I rather go with CRC-32 instead MD5, because I am looking to just compare a file to a hash.

einstein1969
Expert
Posts: 960
Joined: 15 Jun 2012 13:16
Location: Italy, Rome

Re: Generate CRC-32 Checksum with batch file

#7 Post by einstein1969 » 18 Jun 2014 15:14

Adrianvdh wrote:Well then shouldn't I rather go with CRC-32 instead MD5, because I am looking to just compare a file to a hash.


I have finished my work. You can find code in this post

einstein1969

Post Reply