Hello,
if any one can crate code for given information its helps lot to me
actually i want a code like :
For example : have to create folder with name 100 - 199
next subfolder 100, 101, 102, 103,.... and so on till 199, series of number should take automatically.
inside subfolder 1,2,3 folders should be create.
it should be go on loop
Kindly help me on this.
Create folder and subfolder structure using a loop…
Re: Create folder and subfolder structure using a loop…
Code: Select all
base = %A_ScriptDir%
Loop, 100 {
dir := base "\100 - 199\" A_Index + 99
Loop, 3 {
FileCreateDir, % dir2 := dir "\" A_Index
If ErrorLevel
MsgBox, 48, Error, An error occurred when creating the directory.`n`n%dir2%
}
}
MsgBox, 64, Done, Done!
Re: Create folder and subfolder structure using a loop…
Thank you mikeyww,
but actually i am using daily this code so
I need like insted of entering 100 - 199 in code, can we use in MSGBOX so we can enter other no's also like 200 - 299, 300 - 399..... and so on
and folder will create in some particular path, like this i need
100 - 199 - inside this
100 - Inside this
(Affected, Not Affected, Miscellaneous, Screenshots & Visio) these four folders
i tried to write code by usings those code but i m not able to write, can you please help on this.
Actually for single folder i am using below code
" InputBox, LMtargetfolder
targetfolder = %LMtargetfolder%
FileCreateDir, %A_Desktop%\Order\%targetfolder%
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Miscellaneous
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Screenshots & Visio
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Order Information
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Not Affected
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Affected
Return "
but i am not able to make loop and write code. PLease help me on this.
but actually i am using daily this code so
I need like insted of entering 100 - 199 in code, can we use in MSGBOX so we can enter other no's also like 200 - 299, 300 - 399..... and so on
and folder will create in some particular path, like this i need
100 - 199 - inside this
100 - Inside this
(Affected, Not Affected, Miscellaneous, Screenshots & Visio) these four folders
i tried to write code by usings those code but i m not able to write, can you please help on this.
Actually for single folder i am using below code
" InputBox, LMtargetfolder
targetfolder = %LMtargetfolder%
FileCreateDir, %A_Desktop%\Order\%targetfolder%
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Miscellaneous
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Screenshots & Visio
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Order Information
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Not Affected
FileCreateDir, %A_Desktop%\Order\%targetfolder%\Affected
Return "
but i am not able to make loop and write code. PLease help me on this.
Re: Create folder and subfolder structure using a loop…
Your example has a fragmented description, and missing details. I am having trouble following all of it. Please write the complete steps in order:
1. InputBox appears. User enters (for example) ____________.
2. New folders named ______ are then defined.
3. If those folders already exist, then __________; otherwise, ____________.
4. Finally, subfolders named ____ are created.
Next time around, I would recommend providing the details in your initial post. Parsing the results of an inputbox are not part of the originally stated goal, and you also did not originally provide the subfolder names. These omissions would make coding the right script impossible. The omissions increase the time needed for you to get to what you want, and also needlessly add time for the coder.
1. InputBox appears. User enters (for example) ____________.
2. New folders named ______ are then defined.
3. If those folders already exist, then __________; otherwise, ____________.
4. Finally, subfolders named ____ are created.
Next time around, I would recommend providing the details in your initial post. Parsing the results of an inputbox are not part of the originally stated goal, and you also did not originally provide the subfolder names. These omissions would make coding the right script impossible. The omissions increase the time needed for you to get to what you want, and also needlessly add time for the coder.
Re: Create folder and subfolder structure using a loop…
if we run code
Steps :
1. InputBox : once we enter 100 - 199 then
2. Create (100 - 199) this folder
3. inside that 100, 101, 102, 103...... and so on till 199 sub folder will create
4. inside 100 , 101.... this four sub sub folders should create (Affected, Not Affected, Miscellaneous, Screenshots & Visio) for ever sub folders.
like this
this the structure for code, please help me on this.
Steps :
1. InputBox : once we enter 100 - 199 then
2. Create (100 - 199) this folder
3. inside that 100, 101, 102, 103...... and so on till 199 sub folder will create
4. inside 100 , 101.... this four sub sub folders should create (Affected, Not Affected, Miscellaneous, Screenshots & Visio) for ever sub folders.
like this
this the structure for code, please help me on this.
Re: Create folder and subfolder structure using a loop…
Small sample may help
Code: Select all
Gui, Add, Edit, vWD w220 HwndE
EM_SetCueBanner(E, "Working directory...")
Gui, Add, Button,, Select
Gui, Add, Edit, vFrom Number w100 HwndE, 100
EM_SetCueBanner(E, "From...")
Gui, Add, Edit, vTo xp+120 Number w100 HwndE, 199
EM_SetCueBanner(E, "To...")
Gui, Add, Edit, xm vFolder w220 r5, % "Affected"
. "`nNot Affected"
. "`nMiscellaneous"
. "`nScreenshots & Visio"
Gui, Add, Button, Disabled, Create
Gui, Show
ButtonSelect:
FileSelectFolder, WD
If (WD != "") {
GuiControl,, WD, % WD
GuiControl, Enable, Create
}
Return
GuiClose:
ExitApp
ButtonCreate:
GuiControlGet, WD
GuiControlGet, From
GuiControlGet, To
GuiControlGet, Folder
While (From <= To) {
FileCreateDir, % WD "\" From
Loop, Parse, Folder, `n, `r
FileCreateDir, % WD "\" From "\" A_LoopField
++From
}
Msgbox, OK
Return
EM_SetCueBanner(Hwnd, Cue) {
Return DllCall("User32.dll\SendMessage", "Ptr", Hwnd, "UInt", 0x1501, "Ptr", False, "WStr", Cue)
}
Re: Create folder and subfolder structure using a loop…
Thank you Smile_
its helping me lot
its helping me lot