41
Support and Feedback / Re: How to display highlighted file details, not selecting it?
« Last post by Mathias (Author) on February 09, 2025, 20:18:58 »No the status field in the file list is currently not customizable
MultiCommander v14.2 is released!
@var $currentPath = GetSourcePath();
@var $Items = GetSourceItems();
@var $count = arrayCount($Items);
@var $curItem;
@var $fullFilename;
@var $array2[];
// Loop all items in the $Items array
for( $n = 0; $n < $count; $n++)
{
$curItem = $Items[$n];
$fullFilename = $currentPath ^ $curItem;
@var $isMatch = StrIsRegExpMatchNoCase($fullFilename, "[a-z0-9]{30}");
if($isMatch)
{
arrayAdd($array2, $curItem);
}
}
@var $options[] = {"NODIALOG"};
DeleteFiles($array2, $options);
@echo off
setlocal
REM Set the base directory
set "base_dir=C:\dir\to\scan\"
REM Set the full path to the 7-zip executable
set "7zip_path=C:\Program Files\7-Zip\7z.exe"
REM Set the log file path
set "log_file=%base_dir%\operations_log.txt"
REM Initialize the log file
echo Log file created on %date% at %time% > "%log_file%"
REM Recursively scan for folders named "a" and "b"
for /d /r "%base_dir%" %%d in (.) do (
if exist "%%d\a" (
echo Compressing folder "a" in "%%d" >> "%log_file%"
"C:\Program Files\7-Zip\7z.exe" a -t7z -mx=9 "%%d\a.7z" "%%d\a\" >> "%log_file%" 2>&1
if exist "%%d\a.7z" (
echo Zip succeeded. Deleting folder "%%d\a" >> "%log_file%"
rmdir /s /q "%%d\a" >> "%log_file%" 2>&1
) else (
echo Failed to create zip for "%%d\a" >> "%log_file%"
)
)
if exist "%%d\b" (
echo Compressing folder "b" in "%%d" >> "%log_file%"
"C:\Program Files\7-Zip\7z.exe" a -t7z -mx=9 "%%d\b.7z" "%%d\b\" >> "%log_file%" 2>&1
if exist "%%d\b.7z" (
echo Zip succeeded. Deleting folder "%%d\b" >> "%log_file%"
rmdir /s /q "%%d\b" >> "%log_file%" 2>&1
) else (
echo Failed to create zip for "%%d\b" >> "%log_file%"
)
)
)
endlocal
@var $zipPath = "C:\Program Files\7-Zip\7z.exe";
@var $scanDir = "C:\path\to\the\directory";
@function CompressFolder($folderPath, $folderName) {
@var $zipFileName = "$folderName.7z";
MC.Run CMD="EXTRACT" TARGET="$folderPath" SOURCE="\"$zipFileName\"" USERCONFIRMATION="NO" ARCHIVE="$zipPath" ARGUMENTS="a -r \"$zipFileName\" \"$folderPath\\*\"";
}
@function ScanFolders($currentDir) {
@var $dirs = MC.Filesystem.ListDirs(path="$currentDir");
@for $dir in $dirs {
@var $folderName = MC.GetValue(PATH="$dir", INDEX="basename");
@if ($folderName == "a" || $folderName == "b") {
CompressFolder($dir, $folderName);
}
ScanFolders($dir);
}
}
ScanFolders($scanDir);