I'll try to keep this basic. I'm trying to run a shell on the server side (not the client). I've broken down my code so it's pretty basic. right now if I run this on the client side using CreateObject("Wscript.shell") it will 'document.write' the user in my browser.
<script type="text/vbscript" >
Set Shell = CreateObject("WScript.Shell")
Set whoami = shell.exec("whoami")
Set whoamiOutput = whoami.StdOut
strWhoamiOutput = whoamiOutput.ReadAll
document.write strWhoamiOutput
</script>
Now if I change my code to run on the server side:
<script type="text/vbscript" >
Set Shell = Server.CreateObject("WScript.Shell")
Set whoami = shell.exec("whoami")
Set whoamiOutput = whoami.StdOut
strWhoamiOutput = whoamiOutput.ReadAll
document.write strWhoamiOutput
</script>
I get an error in my browser telling me 'object required: server' at line 11. Line 11 is the 'Server.CreateObject' line. What am I missing here?
Thanks