I'm trying to use VBScript in HTML to write text into what will become a powershell script. I am doing this to avoid having to statically code into my HTA the location of these powershell scripts.
My problem becomes working around Powershell's " ( and )
An example, I'm just not sure how to wrap the characters in order to keep VBS happy.
Dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("c:\Temp\somefile.txt", ForAppending, True)
filetxt.WriteLine ("Param([Parameter(Mandatory=$true)]")
filetxt.WriteLine ("[string]$Str)")
filetxt.WriteLine ("# Create the IE com object")
filetxt.WriteLine ("$ie = new-object -comobject InternetExplorer.Application")
filetxt.WriteLine ("#Navigate to www.")
filetxt.WriteLine ("$ie.navigate("http://www.page.com")")