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
Hope that helps,
Mark D. MacLachlan
--