A (hopefully) simple question
Posted: 11 Feb 2008 09:26
I've recently had to write a few batch files at work, and have been having some trouble with them. After a lot of attempts at doing everything I needed in the batch files themselfs I decided it would be better for me to stick to what I know, which is C. The trouble that I am haveing now is the following function/command line call:
C:\Sandbox\test\sigtest !count! result.md5 !checksum!
The sigtest is a command line application that takes the following three values, in this order:
A line offset into a file
File to parse
a return value to fill with the result (This is my problem)
After looking around on the web, the general work around seems to be to create and then delete a temp file, however do to memory constraints on the system I am working on this is not a possibility, can anybody offer any advice or assistance on my issue? He is the full code for the batch file.
C:\Sandbox\test\sigtest !count! result.md5 !checksum!
The sigtest is a command line application that takes the following three values, in this order:
A line offset into a file
File to parse
a return value to fill with the result (This is my problem)
After looking around on the web, the general work around seems to be to create and then delete a temp file, however do to memory constraints on the system I am working on this is not a possibility, can anybody offer any advice or assistance on my issue? He is the full code for the batch file.
Code: Select all
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
set /a count=0
set checksum=0
FOR %%x in (C:\Sandbox\test\bin\*.*) Do (
C:\Sandbox\test\sigtest !count! result.md5 !checksum!
echo %%x
echo !checksum!
C:\Sandbox\test\md5 -c%%i %%x
IF ERRORLEVEL == 1 GOTO BAD
IF ERRORLEVEL == 2 GOTO NOFL
)
ECHO all good
PAUSE
CLS
EXIT
:BAD
ECHO the parameters do not match
PAUSE
CLS
EXIT
:NOFL
ECHO file not found
PAUSE
CLS
EXIT