Question

Locked

Batch Files Number formating

By klr650r ·
Hi,
I've got a problem with one of my batch files now, I only noticed this a few months after I started using it.

@ECHO OFF

:: ---------------------------------------------------------------
:: SETTING CURRENT DIRECTORY TO RECOVER OTHER FILES FROM

SET CURRDIR=%CD%

:: ---------------------------------------------------------------
:: LAST MONTHs INFO DELETE


:START
SET drive=F:
SET /a oldfp1=%date:~3,2% - 01
SET /a delfp2=%date:~6,4% - 1
SET /a delfp3=12
IF %oldfp1% EQU 0 SET delfolder=%date:~0,2%_%delfp3%_%delfp2%
IF %oldfp1% NEQ 0 SET delfolder=%date:~0,2%_%oldfp1%_%date:~6,4%
%drive%
IF EXIST %drive%\%delfolder% START %CURRDIR%\DELOLD.bat
pause


That last pause was added so I could see what was happening when I removed @ECHO OFF.

You can see a picture of this result here
http://i158.photobucket.com/albums/t109/klr650r/test.jpg

The IF EXIST F:\02_3_2008 should in fact say The IF EXIST F:\02_03_2008. The subtraction from the 04 (in 04-1, 01 was just one thing I tested) caused the number format to change to a single number.

Is there any way to keep my two number format after the subtraction ?

Any Help in the matter would be greatly appreciated.

Thanks,
Denis

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums