- 帖子
- 33
- 积分
- 48
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2012-10-24
|
2楼
发表于 2012-11-6 09:10
| 只看该作者
这是我简单的修改 ·· 有错误 请高手帮忙
@echo on
setlocal
set ret=0
set FILE_PATH_SND=\TACTICS_AS\FTM\SND\AP\LOG
set FILE_PATH_ARCH=\TACTICS_AS\FTM\SND\_ARCH\AP\LOG
set file_list=dnap1702_*.out
set FILE_ID_PS=""
set FILE_ID_FTM=61WJG0U0
LOG=\appl\jp1\psoft_asmo\_log\%n0.log
set err_msg=""
set date_time=%date:~,4%/%date:~5,2%/%date:~8,2%_%time:~,2%:%time:~3,2%:%time:~6,2%
set date=%date%
echo "%date%:開始" >> $log
for /f "delims=" %%a in (dir /o:-d "%FILE_PATH_SND%\dnap1702_*.out") do (
echo %%a
if not exist %%a (
set err_msg="%FILE_ID_PS%がありません"
call :SUB90_ERR_OUT
set rtn_value=4
goto :SUB99_EXIT
)
copy -p %FILE_ID_PS% %FILE_PATH_ARCH%\%nx0%FILE_ID_PS%-%date_time%
move %FILE_ID_PS% %FILE_PATH_SND%\%FILE_ID_FTM%
utlsend -f %FILE_ID_FTM% -sync
SET ret=%errorlevel%
if not %ret%==0 (
set err_msg="HULFT送信エラーが発生しました[%ret%] ファイルID=%$FILE_ID_FTM%"
call :SUB90_ERR_OUT
set rtn_value=4
goto :SUB99_EXIT
)
set date=%date%
echo "%date%:正常終了" >> %log%
del %FILE_PATH_SND%\%FILE_ID_FTM%
ping /n 60 127.1>nul
goto:SUB99_EXIT
)
:SUB90_ERR_OUT
set datetime=%date% %time%
echo ****** バッチエラー情報 開始 ******>> %LOG%
echo *DATETIME=%datetime% >> %LOG%
echo -------------------------------------------------- >> %LOG%
echo エラーメッセージ =%err_msg% >> %LOG%
echo -------------------------------------------------- >> %LOG%
echo ****** バッチエラー情報 終了 ****** >> %LOG%
echo.>> %log%
exit /b
:SUB99_EXIT
endlocal &&exit /b %rtn_value% |
|