zip the file

HI
I try to use this script to zip the file and once it done
delete the target file

From this script i can generate the list of the file need to zip
when i try to pass the file name one by one and try to zip i get an error

this is my script

set LOCAL_DIR=C: emp1
if %COMPRESS% equ 1 (
echo %time% - Compressing Data Pump Files >> %SLOG% 2>&1
dir %LOCAL_DIR%%DUMPFILE%*.* /b > %LOCAL_DIR%dir.lst
set DIR_LIST=%LOCAL_DIR%dir.lst

FOR /F %%A IN (%DIR_LIST%) DO (
echo Compressing: %%A
rar.exe a %LOCAL_DIR%%%A.zip %LOCAL_DIR%%%A
if %ERRORLEVEL% neq 0 (echo %time% - *** COMPRESS ERROR *** >> %SLOG% 2>&1)
if exist %LOCAL_DIR%%%A.zip (del %LOCAL_DIR%%%A /q)
)
)

---------------

I get the error in Fo loop


Regards
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories