# Batch Scripting - error comparing two numbers



## yogeshsam (Sep 21, 2009)

Dear Experts, 
I am comparing the time difference of current time with process log time, 
time Format is as follows, 
current time = 1526 (which is 03:26pm) 
landed process Log time is = 0945 (which is 09:45am) 

but i am getting following error, 
Invalid number. Numeric constants are either decimal (17), 
hexadecimal (0x11), or octal (021). 

please help!!! 
code:- 
---- 
@echo off 
cd\ 
d: 
cd D:\Test_Setup 
call ProcessStartTime.vbs result of this in processtime.txt is - EXCEL.EXE 20100204094539.749966+330 2644
for /f "tokens=1" %%i in (processtime.txt) do set Proc=%%i 
if %Proc% EQU EXCEL.EXE GOTO yy 
GOTO End 
:yy 
For /f "tokens=2" %%j in (processtime.txt) do set LTIME=%%j 
set LGTIME=%LTIME:~8,4% 
echo License acquired Time is %LGTIME% 

set Ct=%time% 
set Ch=%Ct:~0,2% 
set Cm=%Ct:~3,2% 
Set /a CTIME=%Ch%%Cm% 
echo Current Time is %CTIME% 

set /A TDiff=%CTIME%-%LGTIME% 
echo time differense is %TDiff% 
------


----------



## Squashman (Apr 14, 2005)

You have to stip the leading zero from the time.


----------

