First time posting here. I'm writing a DOS batch script to automate the process of archiving Oracle tables. The archive tool requires a parameter file with tags that need to be populated at run-time. I am using the following logic, trying 2 different methods to catch the error, but when redirecting to a bad path, the error is not being caught. Is there an alternative to ECHO, or an alternate way to detect this write error? Or any other ideas? Thanks much!
-Greg
@ECHO OFF
FOR /F %%G IN (O:\tmp\infile.txt) DO (
...
...
ECHO TABLE=%%G > P:\BADPATH\MYOUTFILE1.TXT
IF %ERRORLEVEL% NEQ 0 GOTO END
...
ECHO TABLE=%%G > P:\BADPATH\MYOUTFILE2.TXT
IF ERRORLEVEL 1 GOTO END
...
...
)
:END
IF %ERRORLEVEL% NEQ 0 ECHO FAILED!
ECHO EXITING