If you have the habit of using "Extract to zipfilename\", in order to avoid tons of files cluttering your desktop if you use "Extract Here" and when the content of the file was not contained in a single root folder, you'll occasionally end up extracting the files into zipfilename\ziprootfolder\*.* where ziprootfolder is then the only item inside the zipfilename folder.
The following script helps you to move all those items into the parent folder.
Code: Select all
$initial = getinfo("CountSelected");
if ($initial == 0) {
echo "Command aborted, nothing is selected!";
end 1;
};
$parent = RegExReplace(<curpath>, "(.*)\\[^\\]+", "$1");
$child = <curfolder>;
moveto $parent;
goto $parent;
sel "[$child]";
Code: Select all
$initial = getinfo("CountSelected");
if ($initial == 0) {
echo "Command aborted, nothing is selected!";
end 1;
};
$parent = RegExReplace(<curpath>, "(.*)\\[^\\]+", "$1");
$child = <curfolder>;
moveto $parent;
sel "a";
$remainder = getinfo("CountSelected");
goto $parent;
if ($remainder == 0) {
if (confirm("Delete the empty folder named '$child'?") == 1) {
delete $child, 1, 0;
end 1;
}
}
sel "[$child]";
XYplorer Beta Club