MultiDel

Title MultiDel
File Name MultiDel.txt
Description Delete same files in all tabs of source panel
Author Vochomurka
Parameters ("%F")
Plugins Called win, tc, file, vec, osd
Icon
Version 2.1
Updated on 16.06.2014
;;If wincmd.ini is not in Windows directory, indicate its path implicitly: 
global Config = env("WINDIR") ++ "/wincmd.ini"
local hwnd = win.handle("c=TTOTAL_CMD")
global TT = cl.Create("Tabs", 1)
win.sendmessage(hwnd, 0x400+51, 580, 0)
static CR = esc(?+\n+, ?+\+)
local i, j, Target

;Sub_ReadTabs - name of script ReadTabs
local T = runfile.Subs\Sub_ReadTabs(tc.active(hwnd))

if(T == 1) do
	win.sendmessage(hwnd, 0x400+51, 908, 0)
	quit
endif

local Str = file.readall(arg(1))

local v = vec.createfromlines(Str)
if(v <= 0) do
	messagebox("ok error", "Vector not created", "VEC plugin error #1")
	quit
endif

local Counter = vec.length(v)

Str = "Are you sure to delete the following files?" ++ CR ++ CR

for(i = 0; i < Counter; i++)
	v[i] = file.nametype(v[i])
	for(j = 0; j < T; j++)
		Target = TT.GetId(j)
		Str = Str ++ Target ++ v[i] ++ CR
	endfor
endfor

local Total = T*Counter

if(messagebox("yesno warning", Str, Total ++ " files in total") == 7)
	quit


for(i = 0; i < T; i++)
	Target = TT.GetId(i)
	for(j = 0; j < Counter; j++)
		Str = i*Counter + j + 1
		Str = Str ++ " of " ++ Total ++ " files deleted"
		osd.show(Str, "INFINITE", "30", "Arial", "-1", "255 000 000")
		file.delete(Target ++ v[j])
	endfor
endfor

osd.hide

Comments:

Attention! This script does not work in Total Commander 7.5 pb1 and pb2!

If you need to delete same name file(s) in several directories, just do the following:


Main Page Total Commander PowerPro