@echo off
rem --- for UTF output
chcp 65001
rem --- for SJIS output
rem chcp 932
set mode=taiwa
set mode=auto

rem cd utility

rem echo Start time=%time% >wk.txt

set python=C:\Python27\python.exe
set prof_path=%2
set temp_dir=%4
set target_file=%prof_path%\conf\KwdHotList.conf
set temp_file=%temp_dir%\outwk.txt

set temp_file=temp_kwd.txt

rem ---- followings fail when kicked from PMS by ProcessBuilder(), Why Japaneese ?
rem if "%prof_path%"=="" set target_file=KwdHotList.conf else set target_file=%prof_path%\conf\KwdHotList.conf
rem if "%temp_dir%"=="" set temp_file=outwk.txt else set temp_file=%temp_dir%\outwk.txt

rem ---- dump
rem -echo prof_path=%prof_path% >>wk.txt
rem -echo temp_dir=%temp_dir% >>wk.txt
rem -echo target_file=%target_file% >>wk.txt
rem -echo temp_file=%temp_file% >>wk.txt

echo OK?
pause

cd ../
%python% kwdUpdate.py %temp_file%
rem copy %temp_file% %target_file%

rem echo End time=%time% >>wk.txt
pause