It's possible.
Create two files with following content
File - tb.vbs
Quote |
---|
'========================================================= acc_name="my_account" 'here is account name fld_name="Outbox" 'here is folder name subj = "Here some files to send" 'here is the message subject tpl_file="C:\APack\TheBat\_Test\att.tpl" 'path to template file need_pack=1 'set: 0 - do not pack, 1 - pack with rar email = "" 'set: "" - ask email, other will be placed in "TO" field rar_exe = "C:\APack\TotalCommander\Util\RAR\Rar.exe" 'path to RAR temp_folder = "c:\Temp" 'path to temp folder '=========================================================
set WSHShell = WScript.CreateObject("WScript.Shell") tb_exe = WSHShell.RegRead("HKCU\Software\RIT\The Bat!\EXE path")
Command = tb_exe & " /MAILU=" & acc_name & ";F=" & fld_name & ";S=""" & subj & """;"
if email = "" then email = InputBox("Enter Email") Command = Command & "TO=""" & email & """;" else Command = Command & "TO=""" & email & """;" end if
set fso = WScript.CreateObject("Scripting.FileSystemObject") set file = fso.OpenTextFile(temp_folder & "tb_files_to_send.txt", 2, true) set Args = Wscript.Arguments
if need_pack=1 then arc_file = temp_folder & "files.rar" if fso.FileExists(arc_file) then fso.DeleteFile(arc_file) end if
pack_command = rar_exe & " a " & arc_file for i=0 to args.count-1 pack_command = pack_command & " """ & args(i) & """" next file.WriteLine "files.rar" for i=0 to args.count-1 file.WriteLine "- " & args(i) next
WSHShell.Run pack_command, 1, true command = command & "A=""" & temp_folder & "files.rar" & """;" else for i=0 to args.count-1 command = command & "A=""" & args(i) & """;" file.WriteLine args(i) next end if
Command = command & "T=""" & tpl_file & """;"
WSHShell.Run command, 1, false |
file - att.tpl
Quote |
---|
Hello, %IF:"%ABTONAME"="":"%TOFName":"%ABTONAME"
See files attached: %PUT="c:\Temp\tb_files_to_send.txt"
-- Best regards, %FromFName mailto:%FromAddr
This is automatically generated message from The Bat! v.3 %BCC="" %BCC="%ABTONAME <%TOADDR>" %TO="" %TO=%BCC %BCC="" |
Fill header part of file tb.vbs with your local paths and names.
Correct template file(att.tpl) if you need.
Place file in "Send To" folder to have this command in right-click menu in Total.
Place tb.vbs in your Total's toolbar and choose proper icon for it.
All questions and suggestions are welcome.
P.S. Sorry for strange symbols in my name and for my bad english.