cdo
Mon Jan 26 08:51:57 CST 2004
Michael,
Thank you very much.....i think this may be what i was looking for. One
more quick ? thou......can you use xcopy with this instead of copy? if so
it should take care of the permissions no matter what source or destination
drive.
"Michael Holzemer" <mholzemer.greyhair@pacbell.net> wrote in message
news:egwOQvr4DHA.2560@TK2MSFTNGP09.phx.gbl...
> > > "John Doe" <cdo@tmecorp.com> wrote in message
> > > news:%235Orr6D4DHA.2348@TK2MSFTNGP09.phx.gbl...
> > > > this is probably an easy one for you scripting gurus.....I need a
> > > > script to copy a 'template' folder to another folder multiple
> > > > times with all subfolders and permissions intact. I need the
> > > > script to rename (number) the folders, i.e. 0001, 0002, 0003. I
> > > > have serveral hundred of these to make and any help would be
> > > > greatly appreciated.
> > > >
> > > > Thanks
> > > >
> > > > Chris
>
> This will create the folder, subfolders, & files. It will not preserve the
> permissions because it is a copy operation rather than a move to the same
> disk operation. Please take some time to look at the below link to see
more
> examples and gain an understanding of the script provided. This script has
> 14 lines.
>
>
> '// Set up loop this does 0001 to 0010
> For i = 1 To 10
> '// Create object to work with files
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> '// Set up my numbering "0001" to "9999"
> '// I am taking only the last 4 digits here
> sFileNum = Right("000" & i, 4)
> '// Do the copy "c:\test" is the folder to copy
> '// the destination is "f:\test0001" etc.
> oFSO.CopyFolder "c:\test" , "F:\test" & sFileNum, True
> '// go around again
> Next
> '// Clean up
> Set oFSO = Nothing
>
> --
> Regards,
>
> Michael Holzemer
> No email replies please - reply in newsgroup
>
> Learn script faster by searching here
>
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
>
>