How could I create some dupicate folder and sub folder one time??

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
rt2ryu
Junior Member
Junior Member
Posts: 17
Joined: 2018-02-26, 10:30 UTC

How could I create some dupicate folder and sub folder one time??

Post by *rt2ryu » 2019-10-14, 18:02 UTC

I want to creat some folder like this structure

Code: Select all

folder a	
--folder head
--folder body
--folder leg
--folder feet
--folder...
folder b	
--folder head
--folder body
--folder leg
--folder feet
--folder...
folder c
--folder head
--folder body
--folder leg
--folder feet
--folder...
...
...
folder z
--folder head
--folder body
--folder leg
--folder feet
--folder...
yeah just about 100 parent folder(it's name have reguarl increase), and each have the same sub folders

I only know to use ctrl+F7 to write

Code: Select all

folder a\head|folder a\body|folder a\leg|folder a\....|

then copy 100 times folder a,Then rename it

So how can I create it one time?

User avatar
sqa_wizard
Power Member
Power Member
Posts: 3502
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: How could I create some dupicate folder and sub folder one time??

Post by *sqa_wizard » 2019-10-14, 18:18 UTC

Well, I assume you already have a folder with all the required subfolders.
All you have to do is to:
- mark the 100 main folders on the right panel
- mark the required subfolders on the left panel
- press F5 for show copy dialog
- enter a not existing filename at "only file of this type" such as xxxxxxxxx
- activate option "Copy to all selected folders ..."
- start the copy process
#5767 Personal license

User avatar
Stefan2
Power Member
Power Member
Posts: 2643
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How could I create some dupicate folder and sub folder one time??

Post by *Stefan2 » 2019-10-14, 19:40 UTC

rt2ryu wrote:
2019-10-14, 18:02 UTC
I want to creat some folder like this structure
....
For example by an scipt

Code: Select all

Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")

'----------------
Flds = Array("a", "B", "C and D", "EFG", "H", "I")
For i = 0 to uBound(Flds)
    F = Flds(i) 
    '    F = Flds(i)  & "_2019"
    '    F = "Client_" & "Flds(i) 
    If NOT FSO.FolderExists(F) Then FSO.CreateFolder F
    CreateSubFld F
Next
'----------------
Sub CreateSubFld(sPath)
    SubFlds = Array("head", "body", "leg", "both feet")
	For x = 0 to uBound(SubFlds)
            S = FSO.BuildPath(sPath , SubFlds(x))
            If NOT FSO.FolderExists(S) Then FSO.CreateFolder S
	Next
End Sub 'CreateSubFld





You could also do smtg like "For A to Z > CreateSubFld " or "For A01 to A99 > CreateSubFld "

For i = 1 to 9
F = i
If NOT FSO.FolderExists(F) Then FSO.CreateFolder F
CreateSubFld F
Next


'A=65, B=66, C=67
For i = 65 to 68
F = chr(i)
If NOT FSO.FolderExists(F) Then FSO.CreateFolder F
CreateSubFld F
Next


 
Inofficial FAQs || WIKI (Deu/Eng) || TC Home (What's new? // FAQ // Download // Order // Addons // Tools // Plugins)
Erst wenn der letzte Baum gefällt oder die letzte Biene verendet ist, werden die Leute verstehen warum Umweltschutz wichtig ist.

User avatar
rt2ryu
Junior Member
Junior Member
Posts: 17
Joined: 2018-02-26, 10:30 UTC

Re: How could I create some dupicate folder and sub folder one time??

Post by *rt2ryu » 2019-10-17, 15:43 UTC

sqa_wizard wrote:
2019-10-14, 18:18 UTC
Well, I assume you already have a folder with all the required subfolders.
All you have to do is to:
- mark the 100 main folders on the right panel
- mark the required subfolders on the left panel
- press F5 for show copy dialog
- enter a not existing filename at "only file of this type" such as xxxxxxxxx
- activate option "Copy to all selected folders ..."
- start the copy process
Thanks it's the way which I want to delegate to one button~ Do you know anyway to do it?

User avatar
rt2ryu
Junior Member
Junior Member
Posts: 17
Joined: 2018-02-26, 10:30 UTC

Re: How could I create some dupicate folder and sub folder one time??

Post by *rt2ryu » 2019-10-17, 15:46 UTC

Stefan2 wrote:
2019-10-14, 19:40 UTC
rt2ryu wrote:
2019-10-14, 18:02 UTC
I want to creat some folder like this structure
....
For example by an scipt

Code: Select all

Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")

'----------------
Flds = Array("a", "B", "C and D", "EFG", "H", "I")
For i = 0 to uBound(Flds)
    F = Flds(i) 
    '    F = Flds(i)  & "_2019"
    '    F = "Client_" & "Flds(i) 
    If NOT FSO.FolderExists(F) Then FSO.CreateFolder F
    CreateSubFld F
Next
'----------------
Sub CreateSubFld(sPath)
    SubFlds = Array("head", "body", "leg", "both feet")
	For x = 0 to uBound(SubFlds)
            S = FSO.BuildPath(sPath , SubFlds(x))
            If NOT FSO.FolderExists(S) Then FSO.CreateFolder S
	Next
End Sub 'CreateSubFld





You could also do smtg like "For A to Z > CreateSubFld " or "For A01 to A99 > CreateSubFld "

For i = 1 to 9
F = i
If NOT FSO.FolderExists(F) Then FSO.CreateFolder F
CreateSubFld F
Next


'A=65, B=66, C=67
For i = 65 to 68
F = chr(i)
If NOT FSO.FolderExists(F) Then FSO.CreateFolder F
CreateSubFld F
Next


 
this way or use bat,C OR Python I know how to do it
but just one question ,everytime I use it showed to out of totalcmd, or trans the path as a var to the process OR write the path manually into the code.

I just want to make it combin into the Totalcmd, Thanks

Post Reply