Code: Select all
echo on
:: search files for string draft in each file held in this folder and echoing result to make sure it is finding the file.
for /f %%i in ('findstr /i /m "draft" DFADV*.*') DO echo Result: ..%%i..
pause
for /f %%i in ('findstr /i /m "draft" DFADV*.*') do call draft.bat ..%%i..
It is echoing the file(s) i'm expecting to find.
draft.bat does checks to see if it exits in a certain format in another folder.
Code: Select all
::draft.bat
echo on
echo Result: ..\%%i..
::checking to see if this file has been processed
::the move command also renames to correct version of the file
if exist D:\FTP\Colby\Order001\%%i.(0) goto check(1)
move D:\FTP\Colby\Holding\\%%i D:\FTP\Colby\Holding\Draft\%%i.(0)
GOTO EOF
(repeated 6x)
Code: Select all
:check(5)
if exist D:\FTP\Colby\Order001\%%i.(5) goto ECHO1
move D:\FTP\Colby\Holding\Draft\%%i D:\FTP\Colby\Holding\Draft\%%i.(5)
GOTO EOF
:ECHO1
"Error you have it set up for 0-5 you need more itterations!"
pause
:EOF
pause
EXIT /B
How do I get the %%i to be passed into the called bat job?
Thanks for your help in advance!