MultiDel

Title MultiDel
File Name MultiDel.txt
Description Delete same files in all tabs of source panel
Author Vochomurka
Parameters ("%F")
Plugins Called win, file, vec
Icon
Version 3.0
Updated on 20.08.17
;;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 j, Target
local i = ifelse(win.sendmessage(hwnd, 0x400+50, 1000, 0) == 1, "left", "right")

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

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 ++= Target ++ v[i] ++ CR
	endfor
endfor

local Total = T*Counter

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

;Sub_Progress - name of script Progress
.Subs\Sub_Progress(0, 0, Total, 0, 5000, "/", "")

for(i = 0; i < T; i++)
	Target = TT.GetId(i)
	for(j = 0; j < Counter; j++)
		Str = i*Counter + j + 1
		.Subs\Sub_Progress@Current(Str)
		file.delete(Target ++ v[j])
	endfor
endfor

Comments:

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


Main Page Total Commander PowerPro