Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute Command stage

Status
Not open for further replies.

11668872

Programmer
Aug 19, 2008
1
CA
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 :pROCESS "%%a" %%~ta

popd
goto :EOF
:pROCESS

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top