Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: Azur Mrodfr on January 06, 2026, 07:16:24

Title: Select files and create a drawer for each file and put each file on each drawer.
Post by: Azur Mrodfr on January 06, 2026, 07:16:24
Hello

I have HDDs with lots of movies files, some of them are inside drawer (some hundred) and some of them without (files directly clickable).

I would like to know if it's possible allready in MultiCommander.

- Select a movie file.
- Use a Multicommander feature that:
- Create a drawer with the name of the movie.
- Put the movie on the drawer

And the best is to do that with one click for hundreds movies.

Thanks for your help.
Title: Re: Select files and create a drawer for each file and put each file on each drawer.
Post by: Mathias (Author) on January 06, 2026, 14:24:19
That is a very special use case.. There is no built in ready to go feature like that.

But you should be able to create a UserDefinedCommand of MultiScript type to do that.
The hard part is to figure out what that the folder name should be. If the folder name can be generated from what the filename is.. then it is easier.

From MultiScript you can get all selected files
Go through them one by one and from file name create the Directory name you want,.
Create that folder and then move the file to that folder..

Then you assign that command to a HotKey/Button/Menu and when you select that command it will run that on all selected files.

https://multicommander.com/Docs/UDC_multiscript
https://multicommander.com/Docs/multiscript/functions/getfilefromview#getselectedpaths
https://multicommander.com/Docs/multiscript/functions/filesystem#movefile
https://multicommander.com/Docs/multiscript/functions/string
https://multicommander.com/Docs/multiscript/examples#file-operations





Title: Re: Select files and create a drawer for each file and put each file on each drawer.
Post by: Azur Mrodfr on January 07, 2026, 05:29:37
Hello

I have posted this questions on another place, like Discord, an a user propose this powershell script. I share with you.
This is a feature not often necessary but usefull when needed. The reverse possibility is also needed sometime.

Sorry for the french below.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Sous window, va dans ton dossier ou ce trouve ceux dans des dossiers et non, fait shift + clic droit dans le vide et choisi l'option ouvrir une fenêtre powershell.

ensuite copie ce script dans powershell et fait enter (n'oublie pas les deux accolade fermante en fin de script:

Get-ChildItem -File | ForEach-Object {
    $folderName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
    if (!(Test-Path $folderName)) {
        New-Item -ItemType Directory -Name $folderName | Out-Null
        Move-Item $_.FullName $folderName
    }
}

Tous tes fichiers qui ne seront pas déjà dans un dossier le seront (à leurs noms respectifs), ceux qui le sont déjà ne seront pas changé.
----------------------------------------------------------------------------------------------------------------------------------------------------


EDIT:
Don't work for all because sometime caracters not handled on the filename with this script:

Move-Item : Impossible de récupérer les paramètres dynamiques pour l'applet de commande. Le modèle de caractères
génériques spécifié n’est pas valide :
Les.Nus.et.les.Morts.(The.Naked.and.the.Dead).1958.BRRiP.720p.x264.AC3.[Repack.Jean.Jacques}.mkv
Au caractère Ligne:5 : 9
+         Move-Item $_.FullName $folderName
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument : (:) [Move-Item], ParameterBindingException
    + FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.MoveItemCommand

Move-Item : Impossible de trouver une partie du chemin d'accès.
Au caractère Ligne:5 : 9
+         Move-Item $_.FullName $folderName
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (M:\Films-HUSH-2...AAC-Notag...mkv:FileInfo) [Move-Item], DirectoryNotFoundE
   xception
    + FullyQualifiedErrorId : MoveFileInfoItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand
Title: Re: Select files and create a drawer for each file and put each file on each drawer.
Post by: Mathias (Author) on January 07, 2026, 07:28:09
Ok if you just what to make the foldername same a filename without ext. then it is a lot easier.

I'm not an powershell expert.. but to fix the powershell script. try asking ChatGPT or similar.. they are pretty good at fixing scripts..

(The reverse is in MC as a copy plugin.  "Copy Content" )
Title: Re: Select files and create a drawer for each file and put each file on each drawer.
Post by: Azur Mrodfr on January 07, 2026, 17:06:43

(The reverse is in MC as a copy plugin.  "Copy Content" )

Interesting, Half the feature allready exist. Thanks.