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

Re: copy folders by name

name
Fri Jan 23 02:37:17 CST 2004

In manual mode, you have the OS

do a fileNamePath(int++)

or e.g. folderName(1).

----------

If you do not have a file where you keep/save/load your logic
as to what from where to where,

there is little chance for anyone to impose a script.

----------

"I have serveral hundred of these "



SURE




"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
>
>


Re: copy folders by cdo

cdo
Fri Jan 23 11:43:18 CST 2004

this wasn't much help....anyone care to provide a little more info???


"name" <nospam@user.com> wrote in message
news:uGI$cwY4DHA.2648@tk2msftngp13.phx.gbl...
> In manual mode, you have the OS
>
> do a fileNamePath(int++)
>
> or e.g. folderName(1).
>
> ----------
>
> If you do not have a file where you keep/save/load your logic
> as to what from where to where,
>
> there is little chance for anyone to impose a script.
>
> ----------
>
> "I have serveral hundred of these "
>
>
>
> SURE
>
>
>
>
> "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
> >
> >
>



Re: copy folders by Michael

Michael
Sat Jan 24 14:51:01 CST 2004

> > "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



Re: copy folders by cdo

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
>
>



Re: copy folders by Michael

Michael
Mon Jan 26 10:34:51 CST 2004

cdo wrote:
> 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.
>

<snip>

You are correct about the permissions. Calling xcopy from script using the
run method. I did not test this. You may want to search google groups for
xcopy, because I am pretty sure there is a ton of information on using it.
There is also a command line newsgroup that may have a batch file
prewritten.
The biggest change in the script is the change from the file system object
to the shell object.

'// Set up loop this does 0001 to 0010
For i = 1 To 10
'// Create shell object
Set oWS = CreateObject("Wscript.shell")
'// 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.
oWS.run "%comspec /C xcopy /e /o c:\test F:\test" & sFileNum
'// go around again
Next
'// Clean up
Set oWS = 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




Re: copy folders by cdo

cdo
Mon Jan 26 10:48:11 CST 2004

Michael...you da man!!!! thanks so much for the help.......


"Michael Holzemer" <mholzemer.greyhair@pacbell.net> wrote in message
news:OuHKTpC5DHA.2560@TK2MSFTNGP09.phx.gbl...
> cdo wrote:
> > 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.
> >
>
> <snip>
>
> You are correct about the permissions. Calling xcopy from script using the
> run method. I did not test this. You may want to search google groups for
> xcopy, because I am pretty sure there is a ton of information on using it.
> There is also a command line newsgroup that may have a batch file
> prewritten.
> The biggest change in the script is the change from the file system object
> to the shell object.
>
> '// Set up loop this does 0001 to 0010
> For i = 1 To 10
> '// Create shell object
> Set oWS = CreateObject("Wscript.shell")
> '// 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.
> oWS.run "%comspec /C xcopy /e /o c:\test F:\test" & sFileNum
> '// go around again
> Next
> '// Clean up
> Set oWS = 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
>
>
>