FFC_PATH = 'D:\app\File\FireFileCopy\FFC.exe';
FFC_OPTION = ' /a';
dlg = new Dialog;
fromfld = dlg.openFolder('コピー元フォルダを指定、キャンセルでファイルを指定','c:\');
if (fromfld==null){
fl = dlg.openFiles('コピーするファイルを指定、キャンセルで終了','');
if(fl.count==0){
exit();
}else{
from='';
for(i in fl){
from+=' "'+fl[i]+'"';
}
}
}else{
if(fromfld[fromfld.length-1]=='\'){
fromfld = fromfld.substr(0,fromfld.length-1);
}
from=' "'+fromfld+'"';
}
tofld = dlg.openFolder('コピー先を指定、キャンセルで終了','c:\');
if(tofld==null){
exit();
}else{
if(tofld[tofld.length-1]=='\'){
tofld = tofld.substr(0,tofld.length-1);
}
to=' /to:"'+tofld+'"';
}
cmdline = FFC_PATH+from+to+FFC_OPTION;
var ws = new ActiveXObject("WScript.Shell");
var oExec = ws.Exec(cmdline);
while (oExec.Status == 0){
sleep(500);
}
if(oExec.Status==1){
s = new SMTP;
s.host = '';
s.port = 25;
s.mail['To'] = '';
s.mail['From'] = '';
s.mail['Subject'] = 'コピー完了';
s.mail.message = '下記の処理が終了しました'+"\n"+cmdline;
try{
s.connect();
s.sendMail();
}finally{
s.disconnect();
}
}