i have working vbscript creates group of folders in directory chosen user on windows 2008 r2 server. want modify create additional sub-folders within primary folders being created. i'm googled out , need advice. here working script:
' 26apr2015 jkw -- q&d option explicit dim g_fso: set g_fso = createobject("scripting.filesystemobject") dim tgt: tgt = browsefolder(".", false) dim subdirs: subdirs = array(_ "accounting",_ "anchors",_ "approvals",_ "bid documents",_ "engineering",_ "mold drawings",_ "plans , specs",_ "revisions , cost changes",_ "shops",_ "transmittals"_ ) dim subdir each subdir in subdirs wscript.echo g_fso.createfolder(tgt & "\" & subdir) next function browsefolder( mystartlocation, blnsimpledialog ) ' function generates browse folder dialog ' , returns selected folder string. ' ' arguments: ' mystartlocation [string] start folder dialog, or "my computer", or ' empty string open in "desktop\my documents" ' blnsimpledialog [boolean] if false, additional text field ' displayed folder can selected ' typing qualified path ' ' returns: [string] qualified path selected folder ' ' based on hey scripting guys article ' "how can show users dialog box lets them select folders?" ' http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun05/hey0617.mspx ' ' function written rob van der woude ' http://www.robvanderwoude.com const my_computer = &h11& const window_handle = 0 ' must 0 dim numoptions, objfolder, objfolderitem dim objpath, objshell, strpath, strprompt ' set options dialog window strprompt = "select folder in create subdirectories:" if blnsimpledialog = true numoptions = 0 ' simple dialog else numoptions = &h10& ' additional text field type folder path end if ' create windows shell object set objshell = createobject( "shell.application" ) ' if specified, convert "my computer" valid ' path windows shell's browsefolder method if ucase( mystartlocation ) = "my computer" set objfolder = objshell.namespace( my_computer ) set objfolderitem = objfolder.self strpath = objfolderitem.path else strpath = mystartlocation end if set objfolder = objshell.browseforfolder( window_handle, strprompt, _ numoptions, strpath ) ' quit if no folder selected if objfolder nothing browsefolder = "" exit function end if ' retrieve path of selected folder set objfolderitem = objfolder.self objpath = objfolderitem.path ' return path of selected folder browsefolder = objpath end function
any appreciated.
something this.
for each subdir in subdirs set subdirnew = g_fso.createfolder(tgt & "\" & subdir) 'then repeat other folders g_fso.createfolder(subdirnew.path & "\" & subsubdir) next