Hi

Hopefully someone can help. I need a script which will help me with
the following. I have a Root folder lets say for arguments sake is C:
\folder\

Then within here I have 2 sub folders lets say sub1 and sub2.

So overall I have a folder structure as follows: -

C:\folder\SUB1
C:\folder\SUB2

Within each of these sub folder are countless other sub folders and
below each sub folder (lets say R001) here we have 3 further sub
folders (lets say R001_XXX, R001_YYY, R001_ZZZ)

similarly we have the same under sub2

I need a script to automate the following

1) prompt the user which sub folder they want to create a new folder
in (either sub1 or sub2)
2) Copy the latest folder within here (so say we have R001 up to R0010
then here I would copy R0010) within sub1 or sub2 folder depending on
the choice made in step 1
3) Rename the new R0010 folder to the next number up - R0011 then
rename the sub folders to R0011_XXX, R0011_YYY, R0011_ZZZ
4) finally I need to open some sort of text file (eg notepad) with the
name sof the subfolders in it so that I can easily copy and paste
their names into an application.

Please can anyone help

Des

Re: Automated Folder Scripting Process by McKirahan

McKirahan
Wed Jan 30 09:33:55 CST 2008

<desmond.mcalister@googlemail.com> wrote in message
news:ce87431e-aad0-49d8-b6aa-35609c74fdec@s12g2000prg.googlegroups.com...
> Hi
>
> Hopefully someone can help. I need a script which will help me with
> the following. I have a Root folder lets say for arguments sake is C:
> \folder\
>
> Then within here I have 2 sub folders lets say sub1 and sub2.
>
> So overall I have a folder structure as follows: -
>
> C:\folder\SUB1
> C:\folder\SUB2
>
> Within each of these sub folder are countless other sub folders and
> below each sub folder (lets say R001) here we have 3 further sub
> folders (lets say R001_XXX, R001_YYY, R001_ZZZ)
>
> similarly we have the same under sub2
>
> I need a script to automate the following

[snip and restated below]

It can certainly be done but a few questions first:

Given a partial structure like this:

C:\folder\
C:\folder\SUB1\
C:\folder\SUB1\R001\
C:\folder\SUB1\R001\R001_XXX\
C:\folder\SUB1\R001\R001_YYY\
C:\folder\SUB1\R001\R001_ZZZ\
...
C:\folder\SUB1\R010\R010_XXX\
C:\folder\SUB1\R010\R010_YYY\
C:\folder\SUB1\R010\R010_ZZZ\
C:\folder\SUB2
C:\folder\SUB2\R001\
C:\folder\SUB2\R001\R001_XXX\
C:\folder\SUB2\R001\R001_YYY\
C:\folder\SUB2\R001\R001_ZZZ\

and the instructions below (for SUB1);
you want to create these new subflders?

C:\folder\SUB1\R011\R011_XXX\
C:\folder\SUB1\R011\R011_YYY\
C:\folder\SUB1\R011\R011_ZZZ\



1) prompt the user which sub folder they want to create
a new folder in (either SUB1 or SUB2)

Only subfolders under the root folder?

2) Copy the latest folder within here
(so say we have R001 up to R0010 then here I would copy R0010)
within SUB1 or SUB2 folder depending on the choice made in step 1

Do you mean the highest numbered instead of "latest"?

3) Rename the new R0010 folder to the next number up - R0011
then rename the sub folders to R0011_XXX, R0011_YYY, R0011_ZZZ

Are there always and only those three subfolder suffixes?

4) finally I need to open some sort of text file (eg notepad)
with the names of the subfolders in it so that I can easily
copy and paste their names into an application.

Would the output of the command "dir C:\folder /ad/o" be okay?


Also, what are you really trying to do?
That is, what is the requirement behind this?




Re: Automated Folder Scripting Process by McKirahan

McKirahan
Wed Jan 30 09:36:28 CST 2008

"McKirahan" <News@McKirahan.com> wrote in message
news:Kc6dndd5BvZ-BT3anZ2dnUVZ_uqvnZ2d@comcast.com...

[snip]


> 4) finally I need to open some sort of text file (eg notepad)
> with the names of the subfolders in it so that I can easily
> copy and paste their names into an application.
>
> Would the output of the command "dir C:\folder /ad/o" be okay?

Sorry, I meant: "dir C:\folder /ad/b/o"



Re: Automated Folder Scripting Process by desmond

desmond
Thu Jan 31 02:45:27 CST 2008

On Jan 30, 3:38 pm, "McKirahan" <N...@McKirahan.com> wrote:
> "McKirahan" <N...@McKirahan.com> wrote in message
>
> news:Kc6dndd5BvZ-BT3anZ2dnUVZ_uqvnZ2d@comcast.com...
>
> [snip]
>
> > 4) finally I need to open some sort of text file (eg notepad)
> > with the names of the subfolders in it so that I can easily
> > copy and paste their names into an application.
>
> > Would the output of the command "dir C:\folder /ad/o" be okay?
>
> Sorry, I meant: "dir C:\folder /ad/b/o"

Hi there

Thanks for the response.

Firstly there will only be sub folders under the root folder. I assume
you are asking will there be any files etc. I do mean the highest
numbered. I cant go by modified date because the latest modified
folder is not necessarily the latest. The suffixes will remain
constant. They will always be the same each time. And finally the dir
command would be fine.

Thanks Again

Des

Re: Automated Folder Scripting Process by McKirahan

McKirahan
Thu Jan 31 07:56:12 CST 2008

<desmond.mcalister@googlemail.com> wrote in message
news:a7fab460-868b-43ca-809d-fdabbc5e56bf@h11g2000prf.googlegroups.com...
> On Jan 30, 3:38 pm, "McKirahan" <N...@McKirahan.com> wrote:
> > "McKirahan" <N...@McKirahan.com> wrote in message
> >
> > news:Kc6dndd5BvZ-BT3anZ2dnUVZ_uqvnZ2d@comcast.com...
> >
> > [snip]
> >
> > > 4) finally I need to open some sort of text file (eg notepad)
> > > with the names of the subfolders in it so that I can easily
> > > copy and paste their names into an application.
> >
> > > Would the output of the command "dir C:\folder /ad/o" be okay?
> >
> > Sorry, I meant: "dir C:\folder /ad/b/o"
>
> Hi there
>
> Thanks for the response.
>
> Firstly there will only be sub folders under the root folder. I assume
> you are asking will there be any files etc. I do mean the highest
> numbered. I cant go by modified date because the latest modified
> folder is not necessarily the latest. The suffixes will remain
> constant. They will always be the same each time. And finally the dir
> command would be fine.

By deleting my questions your standalone responses make little sense
to others who may wish to contribute. I'm going to repost my last
response and intermingle your responsess so I can respond effectively.

> > > 1) prompt the user which sub folder they want to create
> > > a new folder in (either SUB1 or SUB2)
> >
> > Only subfolders under the root folder?
>
> Firstly there will only be sub folders under the root folder.
> I assume you are asking will there be any files etc.

That doesn't really answer the question so I'll rephraase:
"Will the user be prompted for only subfolders under the root folder?"
I presumed "yes" but wanted to be sure.

> > > 2) Copy the latest folder within here
> > > (so say we have R001 up to R0010 then here I would copy R0010)
> > > within SUB1 or SUB2 folder depending on the choice made in step 1
> >
> > Do you mean the highest numbered instead of "latest"?
>
> I do mean the highest numbered.
> I cant go by modified date because the latest modified folder
> is not necessarily the latest.

I forgot to ask that since folders will likely.eventually have files do you
really mean ") Copy the latest folder ..." as that would copy files to?
I presume you just want to copy the subfolder structure and not the files.

> > > 3) Rename the new R0010 folder to the next number up - R0011
> > > then rename the sub folders to R0011_XXX, R0011_YYY, R0011_ZZZ
> >
> > Are there always and only those three subfolder suffixes?
>
> The suffixes will remain constant.
> They will always be the same each time.

That doesn't really answer the question so I'll rephraase:
"How many subfolders will there be -- just 3 or might it be more?"

> > > 4) finally I need to open some sort of text file (eg notepad)
> > > with the names of the subfolders in it so that I can easily
> > > copy and paste their names into an application.
> >
> > Would the output of the command "dir C:\folder /ad/b/o" be okay?
>
> And finally the dir command would be fine.

Also, you didn't answer these questions:

> > Also, what are you really trying to do?
> > That is, what is the requirement behind this?

I have an approach in mind but it would help if I understood what
you're really tring to do; you're theoretical example is sketchy.

I appreciate that you've simplified it for general consumption
but it may be helpful if it were descibed in "real world" terms.




Re: Automated Folder Scripting Process by desmond

desmond
Fri Feb 01 03:07:20 CST 2008

Hi

Sorry for being vague. I dont know if you have heard of a solution
called Introspect but that it what it is related to.

I have a Server which I log onto. A user will request that we create a
new folder structure on the F: Drive of the Server. Within the F:
Drive there is a folder called ZANTAZ. Within the ZANTAZ folder there
are two folder called Retail Repositories and Wholesale Repositories.
Within the Retail Repositories folder there are many folders which are
named RE00xxx (xxx being numbers). Within each of these folders there
are 3 sub folders called RE00XXX_Images, RE00XXX_Text,
RE00XXX_Versions. Within the Wholsale Repositories folder there are
many folders which are named WS00xxx (xxx being numbers). Within each
of these folders there are 3 sub folders called WS00XXX_Images,
WS00XXX_Text, WS00XXX_Versions.

The user will request us to create what we call a new clone on the
system. To do this we first ask whether it is a Retail or Wholsale
Clone. Once we have the answer to this question I would copy the last
folder created within the Wholsale Repositories or Retail Repositories
(either WS00XXX or RE00XXX) So it will be the folder with the highest
XXX number. The new folder will have an XXX value of XXX + 1. So say
the user wants a Retail Clone and the latest folder is called RE00204
then I want to create a new folder called RE00205 and the 3 sub
folders should be called RE00205_Images, RE00205_Text,
RE00205_Versions. The RE00204_Images etc... folders do not contain any
files. Ideally I would like the script to create the folder from new
rather than copy but it really does not matter as long as it gets the
job done. Finally I have to copy the names of the 3 sub folders into a
3rd party application so it would be nice to have these 3 names inb a
file which I could copy and paste from.

Hope this makes more sense.

Overall I would like to have a scrfipt to automate all this for me.

Thanks

Des

Re: Automated Folder Scripting Process by McKirahan

McKirahan
Fri Feb 01 09:20:05 CST 2008

<desmond.mcalister@googlemail.com> wrote in message
news:d83d405b-e9ab-47d0-a8f3-dc498fe97a13@i72g2000hsd.googlegroups.com...
> Hi
>
> Sorry for being vague. I dont know if you have heard of a solution
> called Introspect but that it what it is related to.
>
> I have a Server which I log onto. A user will request that we create a
> new folder structure on the F: Drive of the Server. Within the F:
> Drive there is a folder called ZANTAZ. Within the ZANTAZ folder there
> are two folder called Retail Repositories and Wholesale Repositories.
> Within the Retail Repositories folder there are many folders which are
> named RE00xxx (xxx being numbers). Within each of these folders there
> are 3 sub folders called RE00XXX_Images, RE00XXX_Text,
> RE00XXX_Versions. Within the Wholsale Repositories folder there are
> many folders which are named WS00xxx (xxx being numbers). Within each
> of these folders there are 3 sub folders called WS00XXX_Images,
> WS00XXX_Text, WS00XXX_Versions.
>
> The user will request us to create what we call a new clone on the
> system. To do this we first ask whether it is a Retail or Wholsale
> Clone. Once we have the answer to this question I would copy the last
> folder created within the Wholsale Repositories or Retail Repositories
> (either WS00XXX or RE00XXX) So it will be the folder with the highest
> XXX number. The new folder will have an XXX value of XXX + 1. So say
> the user wants a Retail Clone and the latest folder is called RE00204
> then I want to create a new folder called RE00205 and the 3 sub
> folders should be called RE00205_Images, RE00205_Text,
> RE00205_Versions. The RE00204_Images etc... folders do not contain any
> files. Ideally I would like the script to create the folder from new
> rather than copy but it really does not matter as long as it gets the
> job done. Finally I have to copy the names of the 3 sub folders into a
> 3rd party application so it would be nice to have these 3 names inb a
> file which I could copy and paste from.
>
> Hope this makes more sense.
>
> Overall I would like to have a scrfipt to automate all this for me.

Thanks for the detailed requirements; it really helps.

Google found: http://www.zantaz.com/introspect-product-family/

"folders do not contain any files" -- why is that; what's their purpose?

So this folder structure already exists:

F:\ZANTAZ\
F:\ZANTAZ\Retail Repositories\
F:\ZANTAZ\Wholesale Repositories\

And, on request, either this structure will be created:

F:\ZANTAZ\Retail Repositories\RE00xxx
F:\ZANTAZ\Retail Repositories\RE00xxx\RE00xxx_Images\
F:\ZANTAZ\Retail Repositories\RE00xxx\RE00xxx_Text\
F:\ZANTAZ\Retail Repositories\RE00xxx\RE00xxx_Versions\

or this structure will be created:

F:\ZANTAZ\Wholesale Repositories\WS00xxx\
F:\ZANTAZ\Wholesale Repositories\WS00xxx\WS00xxx_Images\
F:\ZANTAZ\Wholesale Repositories\WS00xxx\WS00xxx_Text\
F:\ZANTAZ\Wholesale Repositories\WS00xxx\WS00xxx_Versions\

where "xxx" is a 3-digit number; sequentially assigned.
(Or "00xxx" is a 5-digit number; sequentially assigned.)

A couple of questions while I consider an approach:

1) Would it be okay to have a control file?

For example,

F:\ZANTAZ\ZANTZ.txt

could contain the following:

[Retail Repositories]
RE00001,2008-01-30,Joe
RE00002,2008-01-31,Steve
RE00003,2008-02-01,Mary
[Wholesale Repositories]
WS00001,2008-02-01,Bill

Thus, "RE00004" or "WS00002" would be the next subfolder.

As seen above, the file could also identify when the
new structure was created and by whom.

2) Would the use of an HTA (HTML Application) be acceptable?
Basically, it's a VBScript file with a browser interface.


Please use "Reply To" so I can associate your reply with my post.

Other's may want to contribute and they shouldn't have to open
multiple posts (if they even have them available) to understand us.




Re: Automated Folder Scripting Process by McKirahan

McKirahan
Sat Feb 02 05:11:02 CST 2008

Please respond in the ng so others may benefit.



Re: Automated Folder Scripting Process by desmond

desmond
Sat Feb 02 11:07:19 CST 2008

On Feb 2, 11:13=A0am, "McKirahan" <N...@McKirahan.com> wrote:
> Please respond in the ng so others may benefit.

Apologies. I thought you meant for me to reply to author.

HTA and Control file would be fine. Have you got a script in mind?

Thanks

Des

Re: Automated Folder Scripting Process by McKirahan

McKirahan
Sat Feb 02 14:50:11 CST 2008

<desmond.mcalister@googlemail.com> wrote in message
news:a15b89c7-4def-47f6-840e-99d5e87701d6@d21g2000prf.googlegroups.com...
On Feb 2, 11:13 am, "McKirahan" <N...@McKirahan.com> wrote:
> Please respond in the ng so others may benefit.
>
> Apologies. I thought you meant for me to reply to author.
>
> HTA and Control file would be fine. Have you got a script in mind?


When responding within a newsgroup (ng) you should always use
"Reply Group" and append your response to the bottom of the thread
as this allows other to follow the "conversation" chronologically.


This post contains the contents of three files. Watch for word-wrap.

Study them and test them then let me know if you have any questions.
The HTA's interface is pretty basic. There is sufficient error checking.

1) "ZANTAZ.hta" is used to create new subfolders under:
F:\ZANTAZ\Retail Repositories\ -or-
F:\ZANTAZ\Wholesale Repositories\

Note that the control file is backed up each time.
If "RE00205" is created then before the control file
is updated it is copied to "ZANTAZ.txt.RE00205".
(Periodically, you should delete this backup files.)

2) "ZANTAZ.txt" is the initial control file.
It is only used if no subfolders exist under:
F:\ZANTAZ\Retail Repositories\ -and-
F:\ZANTAZ\Wholesale Repositories\

Note that the control file will work with just 4 lines:
just change the "RE00000" and "WS00000" to the
highest numbered subfolders that already exist.

3) "ZANTAZ.vbs" is used to create/recreate the control file.
It is used if subfolders exist under:
F:\ZANTAZ\Retail Repositories\ -and-
F:\ZANTAZ\Wholesale Repositories\
("ZANTAZ.txt" will be renamed "ZANTAZ.sav".)

Note that this using this script is totally optional.
(However, it will identify all existing subfolders.)

All files should be placed under the folder "F:\ZANTAZ\".

Both scripts identify this folder as the value of "cFOL";
(the value of "cFOL" can be changed for testing purposes).

If you want the files elsewhere then the "Preprocess" code
needs to be modified; (i.e. comparing "cFOL" with "sDIR").


"ZANTAZ.hta" ..................................................

<html>
<head>
<title>ZANTZ.hta</title>
<HTA:Application
ID = "HTA"
ApplicationName = "ZANTZ"
Border = "thin"
BorderStyle = "normal"
Caption = "yes"
ContextMenu="yes"
Icon = "Northwind.ico"
InnerBorder="no"
MaximizeButton = "yes"
MinimizeButton = "yes"
Navigable="yes"
Scroll="yes"
SrollFlat="no"
Selection="yes"
ShowInTaskBar = "yes"
SingleInstance = "yes"
SysMenu = "yes"
Version = "1.0"
WindowState = "maximize"
>
<script type="text/vbscript">
Option Explicit
'****
'* ------------------------------------------------------------------------
----
'* This HTA (HTML Application) does the following:
'* 1) Read the control file ("cTXT") to identify the root folders under
"cFOL"
'* as well as to determine the next new folder name under each root
folder.
'* Display the root folder choices to the user as buttons for
selection.
'* Display of the control file is also an option.
'* 2) Create the new folder & subfolders (per "cSUB") under the selected
root
'* folder. Update the control file with an entry for the new folder.
'* (Note that the control file is copied before it is updated -- in
case.)
'* Display the new subfolder structure created along with a "Close"
button.
'*
'* The basic control file contains 2 lines per root folder (which are in
[]'s):
'* [Retail Repositories]
'* RE00000,yyyy-mm-dd,who
'* [Wholesale Repositories]
'* WS00000,yyyy-mm-dd,who
'* ....+....1....+....2....+ (this line indicates the control file
columns)
'* ------------------------------------------------------------------------
----
'****
'*
'* Declare Constants
'*
Const cHTA = "ZANTAZ.hta" '= Script name
Const cTXT = "ZANTAZ.txt" '= Control file
Const cFOL = "F:\ZANTAZ\" '= Base folder
Const cSUB = "_Images,_Text,_Versions" '= Subfolders list
Const cCTL = "<button class='butt' onclick='Control_File()'>Control
File</button>"
Const cHTM = "<br><br><button class='butt'
onclick=`window.close()`>Close</button>"
Const cWMI = "winmgmts:{impersonationLevel=impersonate}!//."
'*
'* Declare Globals
'*
Dim sCTL
sCTL = "<b>Control file:</b> " & cFOL & cTXT &
"<br><br><pre>?</pre>"
Dim sDIR
sDIR = CreateObject("WScript.Shell").CurrentDirectory & "\"
Dim aFOL()
Dim iFOL
iFOL = 0
Dim sFOL
Dim sHTM
Dim dNOW
dNOW = Now
Dim aSUB()
Dim aTXT()
Dim iTXT
iTXT = 0
Dim sTXT
Dim sWHO
sWHO = ""
Dim sYMD
sYMD = DatePart("yyyy",dNOW) _
& "-" & Right(100+DatePart("m",dNOW),2) _
& "-" & Right(100+DatePart("d",dNOW),2)

Sub Window_Onload()
'****
'* Examine "cFOL"
'****
sHTM = cCTL & "<br><br><b>Create subfolders under (click one):</b>"
'*
'* Declare Variables
'*
Dim strBUT
Dim intDIC
Dim strDIC
Dim booERR
booERR = False
Dim booFOL
booFOL = False
Dim strFOL
Dim strSFN '= SubFolder Name (e.g. "RE00001")
Dim strSFP '= SubFolder Prefix (e.g. "RE")
Dim strSFS '= SubFolder Suffix (e.g. "00001")
Dim intSFX '= SubFolder Suffix (e.g. 00002)
Dim arrSUB '= SUBfolder extensions
arrSUB = Split(cSUB,",")
Dim intSUB
Dim strSUB
Dim arrTXT
Dim intTXT
Dim strTXT
Dim arrVAL
Dim intVAL
Dim strVAL
DIm strWHO
'*
'* Declare Objects
'*
Dim objDIC
Dim objFSO
Dim objTXT
'*
'* Assign Objects
'*
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objDIC = CreateObject("Scripting.Dictionary")
Dim objWMI
Set objWMI = GetObject(cWMI).InstancesOf("Win32_ComputerSystem")
For Each strWHO in objWMI
sWHO = strWHO.UserName & ""
Exit For
Next
'*
'* Preprocess
'*
If LCase(cFOL) <> LCase(sDIR) Then
'*
'* Test this folder
'*
booERR = True
MsgBox cFOL & " <> " & sDIR,vbCritical,cVBS
ElseIf Not objFSO.FolderExists(cFOL) Then
'*
'* Test base folder
'*
booERR = True
MsgBox cFOL & " does not exist!",vbCritical,cHTA
ElseIf Not objFSO.FileExists(cFOL & cTXT) Then
'*
'* Test control file
'*
booERR = True
MsgBox cFOL & cTXT & " does not exist!",vbCritical,cHTA
End If
'*
'* Process
'*
If Not booERR Then
'*
'* Read control file
'*
Set objTXT = objFSO.OpenTextFile(cFOL & cTXT,1)
strTXT = objTXT.ReadAll
Set objTXT = Nothing
'*
'* Test control file
'*
sCTL = Replace(sCTL,"?",strTXT)
arrTXT = Split(strTXT,vbCrLf)
For intTXT = 0 To UBound(arrTXT)
strTXT = arrTXT(intTXT)
If strTXT = "" Then Exit For
If Left(strTXT,1) = "[" _
And Right(strTXT,1) = "]" Then
'*
'* Folders
'*
booFOL = True
strFOL = Mid(strTXT,2,Len(strTXT)-2)
If Not objFSO.FolderExists(cFOL & strFOL) Then
booERR = True
MsgBox cFOL & strFOL & " does not
exist!",vbCritical,cHTA
Exit For
End If
iTXT = iTXT + 1
ReDim Preserve aTXT(iTXT)
aTXT(iTXT) = strTXT & vbCrLf
objDIC.Add strFOL, iTXT
objDIC.Add iTXT, ""
strBUT = "Create_Folders(" & iTXT & ")"
strBUT = "<button class='butt' onclick='" & strBUT &
"'>?</button>"
sHTM = sHTM & "<br><br>" & Replace(strBUT,"?",strFOL)
Else
'*
'* Entries
'*
If booFOL And Left(strTXT,1) = " " Then
aTXT(iTXT) = aTXT(iTXT) & strTXT & vbCrLf
arrVAL = Split(Trim(strTXT),",")
If UBound(arrVAL) = 2 _
And Len(arrVAL(0)) = 7 _
And Not IsNumeric(Left(arrVAL(0),2)) _
And IsNumeric(Right(arrVAL(0),5)) Then
objDIC.Item(iTXT) = arrVAL(0)
If Right(arrVAL(0),5) <> "00000" Then
strSUB = cFOL & strFOL & "\" & arrVAL(0)
If Not objFSO.FolderExists(strSUB) Then
booERR = True
MsgBox strSUB & " does not
exist!",vbCritical,cHTA
Exit For
End If
End If
Else
booERR = True
MsgBox strTXT & "!!",vbCritical,cHTA
Exit For
End If
Else
booERR = True
MsgBox strTXT & "!!!",vbCritical,cHTA
Exit For
End If
End If
Next
End If
'*
'* New folders
'*
If Not booERR Then
ReDim aFOL(iTXT,UBound(arrSUB)+1)
ReDim aSUB(iTXT)
For Each strDIC In objDIC
If Not IsNumeric(strDIC) Then
iFOL = objDIC.Item(strDIC)
strSFN = objDIC.Item(iFOL)
strSFP = Left(strSFN,2)
strSFS = Right(strSFN,5)
intSFX = Right(100001+CInt(strSFS),5)
strSFN = strSFP & intSFX
aFOL(iFOL,0) = cFOL & strDIC & "\" & strSFN
aSUB(iFOL) = strSFN
For intSUB = 0 To UBound(arrSUB)
strSUB = arrSUB(intSUB)
aFOL(iFOL,intSUB+1) = aFOL(iFOL,0) & "\" & strSFN &
strSUB
Next
End If
Next
End If
'*
'* Destroy Objects
'*
Set objDIC = Nothing
Set objFSO = Nothing
Set objWMI = Nothing
'*
'* Finish
'*
If booERR Then sHTM = "<b>Error!</b>"
document.getElementById("Output").innerHTML = sHTM
End Sub

Sub Control_File()
'****
'* Display the control file
'****
document.getElementById("Output").innerHTML = sCTL & cHTM
End Sub

Sub Create_Folders(iFOL)
'****
'* Generate new folder and its subfolders
'****
document.getElementById("Output").innerHTML = "<b>Processing...</b>"
sHTM = "<b>The following folders were created:</b><br>"
'*
'* Declare Variables
'*
Dim strCTF
Dim booERR
booERR = False
Dim strFIL
Dim intFOR
'*
'* Declare Objects
'*
Dim objCTF
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'*
'* Test folder
'*
sFOL = aFOL(iFOL,0)
If objFSO.FolderExists(sFOL) Then
booERR = True
MsgBox sFOL & " already exists!",vbCritical,cHTA
Else
'*
'* Create folder and subfolders
'*
For intFOR = 0 To UBound(aFOL,2)
sFOL = aFOL(iFOL,intFOR)
objFSO.CreateFolder sFOL
sHTM = sHTM & "<br>" & sFOL
Next
'*
'* Backup control file
'*
strFIL = cFOL & cTXT & "." & aSUB(iFOL)
If objFSO.FileExists(strFIL) Then
objFSO.DeleteFile(strFIL)
End If
objFSO.CopyFile cFOL & cTXT, strFIL
'*
'* Replace control file
'*
sTXT = " " & aSUB(iFOL) & "," & sYMD & "," & sWHO & vbCrLf
aTXT(iFOL) = aTXT(iFOL) & sTXT
strCTF = Join(aTXT,"")
Set objCTF = objFSO.CreateTextFile(cFOL & cTXT,True)
objCTF.Write strCTF
Set objCTF = Nothing
End If
'*
'* Destroy Objects
'*
Set objFSO = Nothing
'*
'* Finish
'*
If booERR Then sHTM = "<b>Error!</b>"
document.getElementById("Output").innerHTML = sHTM & cHTM
End Sub
</script>
<style type="text/css">
body { font-family:Arial; font-size:9pt }
td { font-family:Arial; font-size:8pt }
th { font-family:Arial; font-size:8pt; font-weight:bold }
.butt { background-color:white; font-weight:bold; width:300px }
.line { border:solid 1px black }
</style>
</head>
<body>
<h5>ZANTAZ Subfolders</h5>
<span id="Output"></span>
</body>
</html>


"ZANTAZ.txt" ..................................................

[Retail Repositories]
RE00000,yyyy-mm-dd,who
[Wholesale Repositories]
WS00000,yyyy-mm-dd,who


"ZANTAZ.vbs" ..................................................

Option Explicit
'****
'* ------------------------------------------------------------------------
----
'* 1) Create a control file "cTXT" that identifies folders under "cFOL".
'*
'* The control file contains 2+ lines per root folder (which are in []'s):
'* [Retail Repositories]
'* RE00000,yyyy-mm-dd,who
'* [Wholesale Repositories]
'* WS00000,yyyy-mm-dd,who
'* ....+....1....+....2....+ (this line indicates the control file
columns)
'* ------------------------------------------------------------------------
----
'****
'*
'* Declare Constants
'*
Const cVBS = "ZANTAZ.vbs"
Const cTXT = "ZANTAZ.txt"
Const cFOL = "F:\ZANTAZ\"
Const cSAV = ".sav"
Const cSUB = "_Images,_Text,_Versions"
'*
'* Declare Globals
'*
Dim sDIR
sDIR = WScript.ScriptFullName
sDIR = Left(sDIR,InStrRev(sDIR,"\"))
'*
'* Declare Variables
'*
Dim i, j, k
Dim strCTF
strCTF = ""
Dim strDIC
Dim strDLM
Dim booERR
booERR = False
Dim strFIL
Dim arrFOL()
ReDim arrFOL(0)
arrFOL(0) = cFOL
Dim booFOL
booFOL = False
Dim intFOL
intFOL = 0
Dim strFOL
Dim strPRE
Dim strSFN
Dim arrSUB
arrSUB = Split(cSUB,",")
Dim booSUB
Dim intSUB
Dim strSUB
Dim strYMD
'*
'* Declare Objects
'*
Dim objCTF
Dim objDIC
Dim objFSO
Dim objGFO
Dim objTXT
'*
'* Assign Objects
'*
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objDIC = CreateObject("Scripting.Dictionary")
'*
'* Preprocess
'*
If LCase(cFOL) <> LCase(sDIR) Then
'*
'* Test this folder
'*
booERR = True
MsgBox cFOL & " <> " & sDIR,vbCritical,cVBS
ElseIf Not objFSO.FolderExists(cFOL) Then
'*
'* Test base folder
'*
booERR = True
MsgBox cFOL & " does not exist!",vbCritical,cVBS
ElseIf objFSO.FileExists(cFOL & cTXT) Then
'*
'* Test control file
'*
booERR = True
MsgBox cFOL & cTXT & " already exists!",vbCritical,cVBS
End If
'*
'* Process
'*
If Not booERR Then
Call Folders(cFOL)
'*
'* Sort folders
'*
For i = UBound(arrFOL) - 1 To 0 Step -1
For j = 0 To i
If arrFOL(j) > arrFOL(j+1) Then
k = arrFOL(j+1)
arrFOL(j+1) = arrFOL(j)
arrFOL(j) = k
End If
Next
Next
'*
'* List folders
'*
For intFOL = 1 To UBound(arrFOL)
strFOL = arrFOL(intFOL)
strFOL = Mid(strFOL,Len(cFOL)+1)
If strCTF <> "" Then strCTF = strCTF & vbCrLf
If InStr(strFOL,"\") = 0 Then
strPRE = strFOL
strCTF = strCTF & "[" & strFOL & "]"
Else
strDIC = Mid(strFOL,Len(strPRE)+2)
strCTF = strCTF & " " & strDIC & "," & objDIC.Item(strDIC) &
","
End If
Next
'*
'* Backup control file
'*
If objFSO.FileExists(sDIR & cTXT) Then
strFIL = sDIR & cTXT & cSAV
If objFSO.FileExists(strFIL) Then
objFSO.DeleteFile(strFIL)
End If
objFSO.CopyFile sDIR & cTXT, strFIL
End If
'*
'* Replace control file
'*
Set objCTF = objFSO.CreateTextFile(sDIR & cTXT,True)
objCTF.Write strCTF
Set objCTF = Nothing
End If
'*
'* Destroy Objects
'*
Set objDIC = Nothing
Set objFSO = Nothing
'*
'* Finish Message
'*
MsgBox "Done!",vbInformation,cVBS

Sub Folders(folder)
'****
'* Identify all Folders
'****
For Each strFOL In objFSO.GetFolder(folder).SubFolders
If folder = cFOL Then objDIC.Add strFOL.Path, intFOL
'*
'* Skip subfolders in "cSUB"
'*
booSUB = False
For intSUB = 0 To UBound(arrSUB)
strSUB = arrSUB(intSUB)
If InStr(strFOL.Path,strSUB) > 0 Then booSUB = True
Next
'*
'* Save subfolders
'*
If Not booSUB Then
'*
'* DateLastModified
'*
If folder <> cFOL Then
Set objGFO = objFSO.GetFolder(strFOL.Path)
strDLM = objGFO.DateLastModified
Set objGFO = Nothing
strYMD = DatePart("yyyy",strDLM) _
& "-" & Right(100+DatePart("m",strDLM),2) _
& "-" & Right(100+DatePart("d",strDLM),2)
strSFN = Mid(strFOL.Path,Len(folder)+2)
objDIC.Add strSFN, strYMD
End If
'*
intFOL = intFOL + 1
ReDim Preserve arrFOL(intFOL)
arrFOL(intFOL) = strFOL.Path
Call Folders(strFOL.Path)
End If
Next
End Sub



Re: Automated Folder Scripting Process by desmond

desmond
Sun Feb 03 05:20:10 CST 2008

On Feb 2, 8:52=A0pm, "McKirahan" <N...@McKirahan.com> wrote:
> <desmond.mcalis...@googlemail.com> wrote in message
>
> news:a15b89c7-4def-47f6-840e-99d5e87701d6@d21g2000prf.googlegroups.com...
> On Feb 2, 11:13 am, "McKirahan" <N...@McKirahan.com> wrote:
>
> > Please respond in the ng so others may benefit.
>
> > Apologies. I thought you meant for me to reply to author.
>
> > HTA and Control file would be fine. Have you got a script in mind?
>
> When responding within a newsgroup (ng) you should always use
> "Reply Group" and append your response to the bottom of the thread
> as this allows other to follow the "conversation" chronologically.
>
> This post contains the contents of three files. =A0Watch for word-wrap.
>
> Study them and test them then let me know if you have any questions.
> The HTA's interface is pretty basic. =A0There is sufficient error checking=
.
>
> 1) =A0"ZANTAZ.hta" is used to create new subfolders under:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0F:\ZANTAZ\Retail Repositories\ =
-or-
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0F:\ZANTAZ\Wholesale Repositorie=
s\
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Note that the control file is backed up=
each time.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0If "RE00205" is created then before the=
control file
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0is updated it is copied to "ZANTAZ.txt.=
RE00205".
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(Periodically, you should delete this b=
ackup files.)
>
> 2) =A0"ZANTAZ.txt" is the initial control file.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0It is only used if no subfolders exist =
under:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0F:\ZANTAZ\Retail Repositories\ =
-and-
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0F:\ZANTAZ\Wholesale Repositorie=
s\
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Note that the control file will work wi=
th just 4 lines:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0just change the "RE00000" and "WS00000"=
to the
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0highest numbered subfolders that alread=
y exist.
>
> 3) =A0"ZANTAZ.vbs" is used to create/recreate the control file.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0It is used if subfolders exist under:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0F:\ZANTAZ\Retail Repositories\ =
-and-
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0F:\ZANTAZ\Wholesale Repositorie=
s\
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0("ZANTAZ.txt" will be renamed "ZANTAZ.s=
av".)
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Note that this using this script is tot=
ally optional.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(However, it will identify all existing=
subfolders.)
>
> All files should be placed under the folder "F:\ZANTAZ\".
>
> Both scripts identify this folder as the value of "cFOL";
> (the value of "cFOL" can be changed for testing purposes).
>
> If you want the files elsewhere then the "Preprocess" code
> needs to be modified; (i.e. comparing "cFOL" with "sDIR").
>
> "ZANTAZ.hta" ..................................................
>
> <html>
> <head>
> <title>ZANTZ.hta</title>
> <HTA:Application
> =A0ID =3D "HTA"
> =A0ApplicationName =3D "ZANTZ"
> =A0Border =3D "thin"
> =A0BorderStyle =3D "normal"
> =A0Caption =3D "yes"
> =A0ContextMenu=3D"yes"
> =A0Icon =3D "Northwind.ico"
> =A0InnerBorder=3D"no"
> =A0MaximizeButton =3D "yes"
> =A0MinimizeButton =3D "yes"
> =A0Navigable=3D"yes"
> =A0Scroll=3D"yes"
> =A0SrollFlat=3D"no"
> =A0Selection=3D"yes"
> =A0ShowInTaskBar =3D "yes"
> =A0SingleInstance =3D "yes"
> =A0SysMenu =3D "yes"
> =A0Version =3D "1.0"
> =A0WindowState =3D "maximize"
>
> <script type=3D"text/vbscript">
> =A0 =A0 Option Explicit
> '****
> '* =A0--------------------------------------------------------------------=
----
> ----
> '* =A0This HTA (HTML Application) does the following:
> '* =A01) =A0Read the control file ("cTXT") to identify the root folders un=
der
> "cFOL"
> '* =A0 =A0 =A0as well as to determine the next new folder name under each =
root
> folder.
> '* =A0 =A0 =A0Display the root folder choices to the user as buttons for
> selection.
> '* =A0 =A0 =A0Display of the control file is also an option.
> '* =A02) =A0Create the new folder & subfolders (per "cSUB") under the sele=
cted
> root
> '* =A0 =A0 =A0folder. =A0Update the control file with an entry for the new=
folder.
> '* =A0 =A0 =A0(Note that the control file is copied before it is updated -=
- =A0in
> case.)
> '* =A0 =A0 =A0Display the new subfolder structure created along with a "Cl=
ose"
> button.
> '*
> '* =A0The basic control file contains 2 lines per root folder (which are i=
n
> []'s):
> '* =A0 =A0 =A0[Retail Repositories]
> '* =A0 =A0 =A0 RE00000,yyyy-mm-dd,who
> '* =A0 =A0 =A0[Wholesale Repositories]
> '* =A0 =A0 =A0 WS00000,yyyy-mm-dd,who
> '* =A0 =A0 =A0....+....1....+....2....+ (this line indicates the control f=
ile
> columns)
> '* =A0--------------------------------------------------------------------=
----
> ----
> '****
> =A0 =A0'*
> =A0 =A0'* =A0Declare Constants
> =A0 =A0'*
> =A0 =A0 Const cHTA =3D "ZANTAZ.hta" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 '=
=3D Script name
> =A0 =A0 Const cTXT =3D "ZANTAZ.txt" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 '=
=3D Control file
> =A0 =A0 Const cFOL =3D "F:\ZANTAZ\" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 '=
=3D Base folder
> =A0 =A0 Const cSUB =3D "_Images,_Text,_Versions" =A0 =A0 =A0'=3D Subfolder=
s list
> =A0 =A0 Const cCTL =3D "<button class=3D'butt' onclick=3D'Control_File()'>=
Control
> File</button>"
> =A0 =A0 Const cHTM =3D "<br><br><button class=3D'butt'
> onclick=3D`window.close()`>Close</button>"
> =A0 =A0 Const cWMI =3D "winmgmts:{impersonationLevel=3Dimpersonate}!//."
> =A0 =A0'*
> =A0 =A0'* =A0Declare Globals
> =A0 =A0'*
> =A0 =A0 Dim sCTL
> =A0 =A0 =A0 =A0 sCTL =3D "<b>Control file:</b> " & cFOL & cTXT &
> "<br><br><pre>?</pre>"
> =A0 =A0 Dim sDIR
> =A0 =A0 =A0 =A0 sDIR =3D CreateObject("WScript.Shell").CurrentDirectory & =
"\"
> =A0 =A0 Dim aFOL()
> =A0 =A0 Dim iFOL
> =A0 =A0 =A0 =A0 iFOL =3D 0
> =A0 =A0 Dim sFOL
> =A0 =A0 Dim sHTM
> =A0 =A0 Dim dNOW
> =A0 =A0 =A0 =A0 dNOW =3D Now
> =A0 =A0 Dim aSUB()
> =A0 =A0 Dim aTXT()
> =A0 =A0 Dim iTXT
> =A0 =A0 =A0 =A0 iTXT =3D 0
> =A0 =A0 Dim sTXT
> =A0 =A0 Dim sWHO
> =A0 =A0 =A0 =A0 sWHO =3D ""
> =A0 =A0 Dim sYMD
> =A0 =A0 =A0 =A0 sYMD =3D DatePart("yyyy",dNOW) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0& "-" & Right(100+DatePart("m",dNOW),2) _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0& "-" & Right(100+DatePart("d",dNOW),2)
>
> Sub Window_Onload()
> '****
> '* =A0Examine "cFOL"
> '****
> =A0 =A0 sHTM =3D cCTL & "<br><br><b>Create subfolders under (click one):</=
b>"
> =A0 =A0'*
> =A0 =A0'* =A0Declare Variables
> =A0 =A0'*
> =A0 =A0 Dim strBUT
> =A0 =A0 Dim intDIC
> =A0 =A0 Dim strDIC
> =A0 =A0 Dim booERR
> =A0 =A0 =A0 =A0 booERR =3D False
> =A0 =A0 Dim booFOL
> =A0 =A0 =A0 =A0 booFOL =3D False
> =A0 =A0 Dim strFOL
> =A0 =A0 Dim strSFN =A0 =A0 =A0 =A0 =A0'=3D SubFolder Name =A0 (e.g. "RE000=
01")
> =A0 =A0 Dim strSFP =A0 =A0 =A0 =A0 =A0'=3D SubFolder Prefix (e.g. "RE")
> =A0 =A0 Dim strSFS =A0 =A0 =A0 =A0 =A0'=3D SubFolder Suffix (e.g. "00001")=

> =A0 =A0 Dim intSFX =A0 =A0 =A0 =A0 =A0'=3D SubFolder Suffix (e.g. 00002)
> =A0 =A0 Dim arrSUB =A0 =A0 =A0 =A0 =A0'=3D SUBfolder extensions
> =A0 =A0 =A0 =A0 arrSUB =3D Split(cSUB,",")
> =A0 =A0 Dim intSUB
> =A0 =A0 Dim strSUB
> =A0 =A0 Dim arrTXT
> =A0 =A0 Dim intTXT
> =A0 =A0 Dim strTXT
> =A0 =A0 Dim arrVAL
> =A0 =A0 Dim intVAL
> =A0 =A0 Dim strVAL
> =A0 =A0 DIm strWHO
> =A0 =A0'*
> =A0 =A0'* =A0Declare Objects
> =A0 =A0'*
> =A0 =A0 Dim objDIC
> =A0 =A0 Dim objFSO
> =A0 =A0 Dim objTXT
> =A0 =A0'*
> =A0 =A0'* =A0Assign Objects
> =A0 =A0'*
> =A0 =A0 Set objFSO =3D CreateObject("Scripting.FileSystemObject")
> =A0 =A0 Set objDIC =3D CreateObject("Scripting.Dictionary")
> =A0 =A0 Dim objWMI
> =A0 =A0 Set objWMI =3D GetObject(cWMI).InstancesOf("Win32_ComputerSystem")=

> =A0 =A0 For Each strWHO in objWMI
> =A0 =A0 =A0 =A0 sWHO =3D strWHO.UserName & ""
> =A0 =A0 =A0 =A0 Exit For
> =A0 =A0 Next
> =A0 =A0'*
> =A0 =A0'* =A0Preprocess
> =A0 =A0'*
> =A0 =A0 If LCase(cFOL) <> LCase(sDIR) Then
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0'* =A0Test this folder
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 booERR =3D True
> =A0 =A0 =A0 =A0 MsgBox cFOL & " <> " & sDIR,vbCritical,cVBS
> =A0 =A0 ElseIf Not objFSO.FolderExists(cFOL) Then
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0'* =A0Test base folder
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 booERR =3D True
> =A0 =A0 =A0 =A0 MsgBox cFOL & " does not exist!",vbCritical,cHTA
> =A0 =A0 ElseIf Not objFSO.FileExists(cFOL & cTXT) Then
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0'* =A0Test control file
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 booERR =3D True
> =A0 =A0 =A0 =A0 MsgBox cFOL & cTXT & " does not exist!",vbCritical,cHTA
> =A0 =A0 End If
> =A0 =A0'*
> =A0 =A0'* =A0Process
> =A0 =A0'*
> =A0 =A0 If Not booERR Then
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0'* =A0Read control file
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 Set objTXT =3D objFSO.OpenTextFile(cFOL & cTXT,1)
> =A0 =A0 =A0 =A0 =A0 =A0 strTXT =3D objTXT.ReadAll
> =A0 =A0 =A0 =A0 Set objTXT =3D Nothing
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0'* =A0Test control file
> =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 sCTL =3D Replace(sCTL,"?",strTXT)
> =A0 =A0 =A0 =A0 =A0 =A0 arrTXT =3D Split(strTXT,vbCrLf)
> =A0 =A0 =A0 =A0 For intTXT =3D 0 To UBound(arrTXT)
> =A0 =A0 =A0 =A0 =A0 =A0 strTXT =3D arrTXT(intTXT)
> =A0 =A0 =A0 =A0 =A0 =A0 If strTXT =3D "" Then Exit For
> =A0 =A0 =A0 =A0 =A0 =A0 If =A0Left(strTXT,1) =3D "[" _
> =A0 =A0 =A0 =A0 =A0 =A0 And Right(strTXT,1) =3D "]" Then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'* =A0Folders
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'*
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 booFOL =3D True
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 strFOL =3D Mid(strTXT,2,Len(strTXT)-2)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 If Not objFSO.FolderExists(cFOL & strFOL) =
Then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 booERR =3D True
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MsgBox cFOL & strFOL & " does not
> exist!",vbCritical,cHTA
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Exit For
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 End If
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 iTXT =3D iTXT + 1
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ReDim Preserve aTXT(iTXT)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 aTXT(iTXT) =3D strTXT & vbCrLf
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 objDIC.Add strFOL, iTXT
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 objDIC.Add iTXT, ""
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 strBUT =3D "Create_Folders(" & iTXT & ")"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 strBUT =3D "<button class=3D'butt' onclick=
=3D'" & strBUT &
> "'>?</button>"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sHTM =3D sHTM & "<br><br>" & Replace(strBU=
T,"?",strFOL)
> =A0 =A0 =A0 =A0 =