Create Directory with Multiple subs?

Discuss and share scripts and script files...
fuego126
Posts: 6
Joined: 25 May 2019 23:50

Create Directory with Multiple subs?

Post by fuego126 » 26 May 2019 00:07

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!

highend
Posts: 9066
Joined: 06 Feb 2011 00:33

Re: Create Directory with Multiple subs?

Post by highend » 26 May 2019 00:09

And your "part way" looks like?...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

fuego126
Posts: 6
Joined: 25 May 2019 23:50

Re: Create Directory with Multiple subs?

Post by fuego126 » 26 May 2019 00:17

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!

highend
Posts: 9066
Joined: 06 Feb 2011 00:33

Re: Create Directory with Multiple subs?

Post by highend » 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";
    }
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

fuego126
Posts: 6
Joined: 25 May 2019 23:50

Re: Create Directory with Multiple subs?

Post by fuego126 » 26 May 2019 22:47

Thx HighEnd... that did the trick. Appreciate the time..... :beer:

galtar53
Posts: 9
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 » 21 Jun 2020 14:40

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

RalphM
Posts: 1363
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Create Directory with Multiple subs?

Post by RalphM » 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.
Ralph :-)
(OS: W10 1909 Home x64 - XY: Current beta - Office 2019 32-bit)

galtar53
Posts: 9
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 » 21 Jun 2020 21:41

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

highend
Posts: 9066
Joined: 06 Feb 2011 00:33

Re: Create Directory with Multiple subs?

Post by highend » 21 Jun 2020 21:45

Menu - Edit - New - New Folders?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

RalphM
Posts: 1363
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Create Directory with Multiple subs?

Post by RalphM » 22 Jun 2020 03:37

Check out the script above by highend and adapt it to your needs.
Ralph :-)
(OS: W10 1909 Home x64 - XY: Current beta - Office 2019 32-bit)

galtar53
Posts: 9
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 » 22 Jun 2020 13:23

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.

highend
Posts: 9066
Joined: 06 Feb 2011 00:33

Re: Create Directory with Multiple subs?

Post by highend » 22 Jun 2020 13:31

Maybe you provide an excerpt of folders including their subfolders you want to create?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

kotlmg
Posts: 267
Joined: 30 Jun 2010 17:14

Re: Create Directory with Multiple subs?

Post by kotlmg » 22 Jun 2020 15:54

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.

highend
Posts: 9066
Joined: 06 Feb 2011 00:33

Re: Create Directory with Multiple subs?

Post by highend » 22 Jun 2020 15:59

Sure, look at datediff()/ formatdate() and the date variable...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

galtar53
Posts: 9
Joined: 19 Nov 2019 16:33

Re: Create Directory with Multiple subs?

Post by galtar53 » 22 Jun 2020 17:21

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
Attachments
capture1.JPG
capture1.JPG (30.37 KiB) Viewed 328 times

Post Reply