Here's my batch file to do this. Obviously it will require modification
to work for you. I save stuff to a reimport folder and then it is
automatically run when I exit yarn (triggered by the reimport folder
existing).
[D:\os2apps\yarn]type reimport.cmd
@echo off
d:
cd \os2apps\yarn
if not exist home\mail\reimport echo Nothing to do!
if not exist home\mail\reimport goto end
if exist ri-work/* echo Error: previous packet ri-work/* not imported.
if exist ri-work/* goto end
copy home\mail\reimport home\mail\reimport.old
cd ri-work
..\yarnutil\sendfold /Anul ..\home\mail\reimport ^>..\reimport.tmp 2^>^&1
type ..\reimport.tmp
if not exist * goto end
del ..\home\mail\reimport
..\import -u
:end
if not "%1"=="nopause" pause