D
Dimple
Anyone think of a better way to run a VBS file from in ASP than this
example?
(Goal is to run VBS files that use 'wscript.echo' without having to
re-write to use 'response.write'.)
<script language="vbscript" runat="server">
class wscript_class
function echo(s)
response.write(s & "<br>")
end function
function quit()
' dummy
end function
end class
dim wscript
set wscript = new wscript_class
Include "VBS_FILE_TO_USE_HERE.vbs"
Function Include (Scriptname)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(Scriptname)
ExecuteGlobal oFile.ReadAll()
oFile.Close
End Function
</script>
VBS file to use as test:
wscript.echo("vbscript using Wscript.Echo")
example?
(Goal is to run VBS files that use 'wscript.echo' without having to
re-write to use 'response.write'.)
<script language="vbscript" runat="server">
class wscript_class
function echo(s)
response.write(s & "<br>")
end function
function quit()
' dummy
end function
end class
dim wscript
set wscript = new wscript_class
Include "VBS_FILE_TO_USE_HERE.vbs"
Function Include (Scriptname)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(Scriptname)
ExecuteGlobal oFile.ReadAll()
oFile.Close
End Function
</script>
VBS file to use as test:
wscript.echo("vbscript using Wscript.Echo")