Hi,
Im writing a batch file that copies photo's from a memory card to our network drives.
The batch files is set to only copy .jpg's using robocopy. For maximum security we'd like to verify that each of the files is actually a genuine .jpg image file and not a renamed .exe, .zip etc.
Is there a way to accomplish this?
Thanks in advance!
Using a batch file to verify .jpg as image files
Moderator: DosItHelp
You may use Dump EXE file header
If the file is a genuine JPEG it will return nothing. If it's a PE file it will show lots of information. Unfortunately this tool does not seem to handle errorlevel but you can output the result to a text file (or any file) and check its size.
If the size equal to zero then it's not a PE file and we assume it a genuine JPEG.
If the size is greater than zero then its a PE file.
Hope it helps
Code: Select all
http://www.darklich.com/download.php?oId=14
If the file is a genuine JPEG it will return nothing. If it's a PE file it will show lots of information. Unfortunately this tool does not seem to handle errorlevel but you can output the result to a text file (or any file) and check its size.
If the size equal to zero then it's not a PE file and we assume it a genuine JPEG.
If the size is greater than zero then its a PE file.
Hope it helps
-
- Posts: 40
- Joined: 25 Jan 2008 14:05