Manual vs. automated execution problems
Posted: 29 Jan 2010 12:59
I have an audit process that I developed and I made a tweak to it and now it doesn't work as expected when run as a scheduled task. I search for a string in a file and save the output in a temporary file. Here's what I see in the output when automated:
but when run manually:
Here is a segment of the code I have in place:
I've messed around putting SETLOCAL ENABLEDELAYEDEXPANSION and/or SETLOCAL ENABLEEXTENSIONS at the top of this sub batch but it makes things worse.
Anyone have a simple answer? Thanks!
-Sweener
Code: Select all
---------- D:\PATH\FILE.TXT: 0
but when run manually:
Code: Select all
---------- D:\PATH\FILE.TXT: 1
Here is a segment of the code I have in place:
Code: Select all
IF EXIST "D:\FTP\%PROCNAME%\*.txt" FOR /F "tokens=*" %%a in ('dir "D:\FTP\%PROCNAME%\*.txt" /b') DO (
FINDSTR /B /I /N ".put .get put get" "D:\FTP\%PROCNAME%\%%a" > NUL
IF !errorlevel!==0 FIND /I /C "dir" D:\FTP\%PROCNAME%\%%a >> D:\altPath\dir.txt
)
I've messed around putting SETLOCAL ENABLEDELAYEDEXPANSION and/or SETLOCAL ENABLEEXTENSIONS at the top of this sub batch but it makes things worse.
Anyone have a simple answer? Thanks!
-Sweener