D
dimplewathen
Anyone think of a cleaner/nicer/eleganter way of running VBS file in
ASP than this example?
(Goal is to re-use typical VBS code that uses 'wscrip.echo' without
having to re-write everything to use 'response.write'.)
<script language="vbscript" runat="server">
class wscript_class
function echo(s)
response.write(s & "<br>")
end function
function quit()
' do nothing for now
end function
end class
dim wscript
set wscript = new wscript_class
Include "VBSCRIPT_TO_RUN_HERE.vbs"
Function Include (Scriptname)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(Scriptname)
ExecuteGlobal oFile.ReadAll()
oFile.Close
End Function
</script>
Try it with this single line VBS file:
wscript.echo("included vbscript that uses Wscript.Echo")
(The code works; any errors would be from typos introduced while
posting here.)
ASP than this example?
(Goal is to re-use typical VBS code that uses 'wscrip.echo' without
having to re-write everything to use 'response.write'.)
<script language="vbscript" runat="server">
class wscript_class
function echo(s)
response.write(s & "<br>")
end function
function quit()
' do nothing for now
end function
end class
dim wscript
set wscript = new wscript_class
Include "VBSCRIPT_TO_RUN_HERE.vbs"
Function Include (Scriptname)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(Scriptname)
ExecuteGlobal oFile.ReadAll()
oFile.Close
End Function
</script>
Try it with this single line VBS file:
wscript.echo("included vbscript that uses Wscript.Echo")
(The code works; any errors would be from typos introduced while
posting here.)