asp classic - Server.CreateObject("Wscript.Shell") issue - Object Server required error??? ASP/VBscript error -


i'll try keep basic. i'm trying run shell on server side (not client). i've broken down code it's pretty basic. right if run on client side using createobject("wscript.shell") 'document.write' user in 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 change code run on 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 error in browser telling me 'object required: server' @ line 11. line 11 'server.createobject' line. missing here?

thanks

from 'document.write' , 'script' lines appear trying run code in browser... if so, won't able want do.

server.createobject vbscript/asp usage on server itself. (the 'server' object asp object , not available in vbscript in client browser)

to want (if reading between lines correctly) need create asp script (or similar) on server grab output 'whoami' , return/output it. call client-side page via javascript/ajax.

(keep in mind running command using 'wscript.shell' carries own set of security challenges, well)


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -