I managed to trial & error my way through the AI and I've pretty much accomplished what I wanted, deployed the files to the right location, created the SQL script etc.
Now what I want to do is modify the web.config file with some basic stuff such as the APPDIR value etc.
For that I've written a vbs script that reads the config file replaces values I need it and writes it back to the config file. Example is below.
Now where would be the best place to run the script and how do I make it happen? It has to be done after it's been deployed (including the DB).
Code: Select all
Sub ModifyWebConfigFile
Const ForReading = 1, ForWriting = 2
Dim fso, f, ConfigFile
Set fso = CreateObject("Scripting.FileSystemObject")
' Open the file and read it's content
Set f = fso.OpenTextFile("Session.Property("APPDIR") & web.config", ForReading)
ConfigFile = f.ReadAll
f.Close
' Modify the content
ConfigFile = Replace(ConfigFile, "Visual Basic options:", "This is a test replace.")
' Now write the modified content back to the file
Set f = fso.OpenTextFile("Session.Property("APPDIR") & web.config", ForWriting, True)
f.Write ConfigFile
' Close the file
f.Close
End Sub
FOLLOW US