Page 1 of 3

Create Directory with Multiple subs?

Posted: 26 May 2019 00:07
by fuego126
Hi.. .wondering if someone can lead me down the right path.... I want to create a button that will:

a) ask the user for a folder name (ie: Marybeth) And then
1 - create the folder in a specific path (ie: G:\clients\Marybeth)
2 - change to that new directory and create 3 fixed subdirectories (ie: G:\clients\Marybeth\Images, \Text, \Previews)

Thus, at the end of the click, there would be a new G:\clients folder with the 3 subfolders.... I got part way into this but not any further. Thx!

Re: Create Directory with Multiple subs?

Posted: 26 May 2019 00:09
by highend
And your "part way" looks like?...

Re: Create Directory with Multiple subs?

Posted: 26 May 2019 00:17
by fuego126
I was able to get the input box to appear and create the new folder....

Code: Select all

input $name, "Enter the name of the new folder to create";
 new "<curpath>\$name", dir;
But - I was not able to force it to a specific path (ie: G:\clients) nor could I find the chg directory command... thx for your advice!

Re: Create Directory with Multiple subs?

Posted: 26 May 2019 00:27
by highend
This is way off...

Code: Select all

    $dstPath = "R:\test";
    $subFolders = "Images|Text|Previews";

    $folderName = input("Enter the desired folder name");
    if ($folderName) {
        foreach($subFolder, $subFolders, , "e") {
            new("$dstPath\$folderName\$subFolder", "dir");
        }
        goto "$dstPath\$folderName";
    }

Re: Create Directory with Multiple subs?

Posted: 26 May 2019 22:47
by fuego126
Thx HighEnd... that did the trick. Appreciate the time..... :beer:

Re: Create Directory with Multiple subs?

Posted: 21 Jun 2020 14:40
by galtar53
bonjour,
je veux créer plusieur répertoire suivant une liste connue, et à l'interieur de c'est répertoire je veux faire des sous dossiers spécifique.
CORDIALEMENT

Re: Create Directory with Multiple subs?

Posted: 21 Jun 2020 17:11
by RalphM
Welcome to the forum.
As the number of French speaking forum members is certainly less than the English speaking ones, you will get more replies if you manage to post in English.

Re: Create Directory with Multiple subs?

Posted: 21 Jun 2020 21:41
by galtar53
RalphM wrote: 21 Jun 2020 17:11 Welcome to the forum.
As the number of French speaking forum members is certainly less than the English speaking ones, you will get more replies if you manage to post in English.
Ok Thanks

I want a lisp to create several directories according to a known list, and inside this directory I want to make specific sub-folders.
thank you

Re: Create Directory with Multiple subs?

Posted: 21 Jun 2020 21:45
by highend
Menu - Edit - New - New Folders?

Re: Create Directory with Multiple subs?

Posted: 22 Jun 2020 03:37
by RalphM
Check out the script above by highend and adapt it to your needs.

Re: Create Directory with Multiple subs?

Posted: 22 Jun 2020 13:23
by galtar53
RalphM wrote: 22 Jun 2020 03:37 Check out the script above by highend and adapt it to your needs.

but the problem is how to make several directories, the script gives me only one directory to do, because I have a list of directories, and I want to do it once without starting the script each time to do one directory.

Re: Create Directory with Multiple subs?

Posted: 22 Jun 2020 13:31
by highend
Maybe you provide an excerpt of folders including their subfolders you want to create?

Re: Create Directory with Multiple subs?

Posted: 22 Jun 2020 15:54
by kotlmg
highend wrote: 26 May 2019 00:27 This is way off...

Code: Select all

    $dstPath = "R:\test";
    $subFolders = "Images|Text|Previews";

    $folderName = input("Enter the desired folder name");
    if ($folderName) {
        foreach($subFolder, $subFolders, , "e") {
            new("$dstPath\$folderName\$subFolder", "dir");
        }
        goto "$dstPath\$folderName";
    }
hello highend,
1. is it possible to name subfolders as folder with yeasteday, folder with today and folder with tomorrow date? i.e 2020-06-21, 2020-06-22, 2020-06-23. folder names to change dynamically.
2. i want a new folder with today's date to be created in the above folder path automatically and daily. the moment i start xyplorer, folder with todays date to be created.

Re: Create Directory with Multiple subs?

Posted: 22 Jun 2020 15:59
by highend
Sure, look at datediff()/ formatdate() and the date variable...

Re: Create Directory with Multiple subs?

Posted: 22 Jun 2020 17:21
by galtar53
highend wrote: 22 Jun 2020 13:31 Maybe you provide an excerpt of folders including their subfolders you want to create?
see the attached file
for example :
I) parent file: P18943
1) Sub-folder 1: "Enquête Parcellaire"
2) Subfolder 2: "Enquête Juridique".
moreover I want to drag files which have the same prefix as the Parent folder, in the sub-folder created "Enquête Parcellaire" ex:
P18943-PV.pdf
P18943-Minute-PV.pdf
P18943-Plan.pdf
P18943-ZN2.pdf
P18943-Plan.dxf

In short, the goal is to create the parent folder with the same name as the files and drag all the files with the same name (ex: P18943-.... etc. or
P18944 -.... etc, Or...etc) let's choose sub-folder 1: "Enquête Parcellaire".

Thank you for your help