Home All Groups Group Topic Archive Search About

Deployment to multiple folders with Robocopy

Author
9 Jul 2009 12:34 AM
masterslave
I need to deploy an ASP.NET application to multiple folders in IIS,
the application is a template with different parameters for each site
set in web.config. I'm trying to create a script with Robocopy that
would look at all directories in IIS and if a directory meets certain
criteria (has a specific file in it to make sure that this is the
required application folder) then copy files into it overwriting all
the contents.

I can't really work out how to do it in Robocopy that does look like a
good tool though so any advice much appreciated!

Author
9 Jul 2009 7:18 AM
Pegasus [MVP]
"masterslave" <ocb***@gmail.com> wrote in message
news:9ef29e98-f569-49aa-b54e-2b60857ff3c2@y10g2000prf.googlegroups.com...
>I need to deploy an ASP.NET application to multiple folders in IIS,
> the application is a template with different parameters for each site
> set in web.config. I'm trying to create a script with Robocopy that
> would look at all directories in IIS and if a directory meets certain
> criteria (has a specific file in it to make sure that this is the
> required application folder) then copy files into it overwriting all
> the contents.
>
> I can't really work out how to do it in Robocopy that does look like a
> good tool though so any advice much appreciated!

You need to wrap robocopy into a batch file that looks into the various
folders. If you post specific details about folder names, file names and
your criteria then someone will suggest a suitable solution.
Author
9 Jul 2009 8:23 AM
Mark D. MacLachlan
masterslave wrote:

> I need to deploy an ASP.NET application to multiple folders in IIS,
> the application is a template with different parameters for each site
> set in web.config. I'm trying to create a script with Robocopy that
> would look at all directories in IIS and if a directory meets certain
> criteria (has a specific file in it to make sure that this is the
> required application folder) then copy files into it overwriting all
> the contents.
>
> I can't really work out how to do it in Robocopy that does look like a
> good tool though so any advice much appreciated!

Need more details.  Are you looking to have a script that is part of a
web page or that will run as a scheduled task?

Basics of what you are looking for are simple.  Something like this:

[code]
Dim objFSO, WshShell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("wscript.Shell")

Set objFolder = objFSO.GetFolder("C:\InetPub\WWWRoot")

For Each sFolder In objFolder.SubFolders
    If objFSO.FileExists(sFolder.Path & "\TestFile.txt") Then
        WshShell.Run("CMD.EXE /C ROBOCOPY SourceDir " & sFolder.Path & "\
/MIR")
    End If
Next
[/code]

Hope that helps,

Mark D. MacLachlan



--
Author
9 Jul 2009 11:37 PM
masterslave
Thanks for the replies, guys! I would like to look at every folder
inside
C:\Inetpub\wwwroot and if a folder contains a file called
PriceComparison.aspx
then it is the folder I'm looking for and would like to overwrite it
with the contents
of the folder D:\Temp\OclCommerce. I'm looking for running the script
on
ad hoc basis, for updates - running a batch file would suit the
purpose perfectly!

Show quoteHide quote
On Jul 9, 6:23 pm, "Mark D. MacLachlan" <markd***@live.com> wrote:
> masterslave wrote:
> > I need to deploy an ASP.NET application to multiple folders in IIS,
> > the application is a template with different parameters for each site
> > set in web.config. I'm trying to create a script with Robocopy that
> > would look at all directories in IIS and if a directory meets certain
> > criteria (has a specific file in it to make sure that this is the
> > required application folder) then copy files into it overwriting all
> > the contents.
>
> > I can't really work out how to do it in Robocopy that does look like a
> > good tool though so any advice much appreciated!
>
> Need more details.  Are you looking to have a script that is part of a
> web page or that will run as a scheduled task?
>
> Basics of what you are looking for are simple.  Something like this:
>
> [code]
> Dim objFSO, WshShell
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set WshShell = CreateObject("wscript.Shell")
>
> Set objFolder = objFSO.GetFolder("C:\InetPub\WWWRoot")
>
> For Each sFolder In objFolder.SubFolders
>         If objFSO.FileExists(sFolder.Path & "\TestFile.txt") Then
>                 WshShell.Run("CMD.EXE /C ROBOCOPY SourceDir " & sFolder.Path & "\
> /MIR")
>         End If
> Next
> [/code]
>
> Hope that helps,
>
> Mark D. MacLachlan
>
> --