Version and language can be checked with the UI (right click on the file -> properties ...)
Check sum implementations is described here :
http://msdn.microsoft.com/en-us/library ... usersguide
- but I'm not sure how reliable is . (only 8 symbols?)
here's the (still unfinished) script:
Code: Select all
; @echo off
;;setlocal DISABLEDELAYEDEXPANSION ENABLEEXTENSIONS
;;goto :end_help
;;;
;;; fileinf /l list of full file paths separated with ; (if file is more than one enclose all of them in double quotes)
;;; fileinf /f text file with a list of files to be processed ( one on each line )
;;; fileinf /? prints the help
;;;
;;:end_help
; REM Creating a Newline variable (the two blank lines are required!)
; set NLM=^
; set NL=^^^%NLM%%NLM%^%NLM%%NLM%
; if "%~1" equ "/?" type "%~f0" | find ";;;" | find /v "find" && exit /b 0
; if "%~2" equ "" type "%~f0" | find ";;;" | find /v "find" && exit /b 0
; setlocal enableDelayedExpansion
; if "%~1" equ "/l" (
; set "_files=%~2"
; echo !_files:;=%NL%!>"%TEMP%\file.paths"
; set _process_file="%TEMP%\file.paths"
; goto :get_info
; )
; if "%~1" equ "/f" if exist "%~2" (
; set _process_file="%~2"
; goto :get_info
; )
; echo incorect parameters & exit /b 1
; :get_info
; set "file_info="
; makecab /d InfFileName=%TEMP%\file.inf /d "DiskDirectory1=%TEMP%" /f "%~f0" /f %_process_file% /v0>nul
; for /f "usebackq skip=4 delims=" %%f in ("%TEMP%\file.inf") do (
; set "file_info=%%f"
; echo !file_info:,=%nl%!
; )
; endlocal
;endlocal
; del /q /f %TEMP%\file.inf 2>nul
; del /q /f %TEMP%\file.path 2>nul
; exit /b 0
.set DoNotCopyFiles=on
.set DestinationDir=;
.set RptFileName=nul
.set InfFooter=;
.set InfHeader=;
.Set ChecksumWidth=8
.Set InfDiskLineFormat=;
.Set Cabinet=off
.Set Compress=off
.Set GenerateInf=ON
.Set InfDiskHeader=;
.Set InfFileHeader=;
.set InfCabinetHeader=;
.Set InfFileLineFormat=",file:*file*,date:*date*,size:*size*,csum:*csum*,time:*time*,vern:*ver*,vers:*vers*,lang:*lang*"
the .bat file is using itself as a directive file and the files to process are in a separate directive file (makecab can use more than one directive files at the same time) as the semi-colon is a comment in directive files and delimiter in the batch they can be combined without a problem.
I've tried to deactivate the redundant options with initializing a comment before value definition for makecab directives where there are no ON/OFF switches.
For furthers study : looks possible to create file splitter/assembler with makecab and expand.And in the doc above I think I saw something about self extracting files.
example output:
Code: Select all
C:\test>fileinfo.bat /l C:\Windows\HelpPane.exe
file:HelpPane.exe
date:01/21/08
size:734720
csum:b2a70166
time:04:50:02a
vern:6.0.6001.18000
vers:6.0.6000.16386 (vista_rtm.061101-2205)
lang:1033