Hi
I'm using in Execute Command stage to call a DOS batch script that in turn runs .bat, my parameters is:
Command: @
Parameters: "#seq_path#\#APORIProcessDeleteFile#" ( \\filedev\ETLDataFiles\Devl\DM\XXX\Test1\deletefile.bat )
But I have trouble because it does not make the call to the script: the contents of the bat is as follows:
(Delete files with more than 6 months)
@echo off
setlocal
set cutOff=%~2
set workDir=%~1
if "%1"=="" set workDir=.
if not "%cutOff%"=="" goto START
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
set mm=%%a
set dd=%%b
set yyyy=%%c
)
set /a mm=1%mm% -6 - 101
if /i %mm% LSS 1 set /a mm=12&set /a yyyy-=1
if /i %mm% LSS 10 set mm=0%mm%
set cutOff=%yyyy%%mm%%dd%
:START
pushd.
cd /D "%workDir%"
for /f "delims=" %%a in ('dir /b /a-d 2^>NUL') do if /i "%%a" NEQ "%0" call ROCESS "%%a" %%~ta
popd
goto :EOF
ROCESS
for /f "tokens=1-3 delims=/" %%a in ('echo %2') do (
set cmm=%%a
set cdd=%%b
set cyyyy=%%c
)
if /i "%cyyyy%%cmm%%cdd%" LEQ "%cutOff%" del %1
Thanks advanced.
Javier
I'm using in Execute Command stage to call a DOS batch script that in turn runs .bat, my parameters is:
Command: @
Parameters: "#seq_path#\#APORIProcessDeleteFile#" ( \\filedev\ETLDataFiles\Devl\DM\XXX\Test1\deletefile.bat )
But I have trouble because it does not make the call to the script: the contents of the bat is as follows:
(Delete files with more than 6 months)
@echo off
setlocal
set cutOff=%~2
set workDir=%~1
if "%1"=="" set workDir=.
if not "%cutOff%"=="" goto START
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
set mm=%%a
set dd=%%b
set yyyy=%%c
)
set /a mm=1%mm% -6 - 101
if /i %mm% LSS 1 set /a mm=12&set /a yyyy-=1
if /i %mm% LSS 10 set mm=0%mm%
set cutOff=%yyyy%%mm%%dd%
:START
pushd.
cd /D "%workDir%"
for /f "delims=" %%a in ('dir /b /a-d 2^>NUL') do if /i "%%a" NEQ "%0" call ROCESS "%%a" %%~ta
popd
goto :EOF
ROCESS
for /f "tokens=1-3 delims=/" %%a in ('echo %2') do (
set cmm=%%a
set cdd=%%b
set cyyyy=%%c
)
if /i "%cyyyy%%cmm%%cdd%" LEQ "%cutOff%" del %1
Thanks advanced.
Javier