Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WScript.Shell Problems

Status
Not open for further replies.

yu217171

Programmer
Aug 2, 2002
203
CA
Hi everyone,

I'm trying to run the command "net send message" from the command prompt from a webpage, on the CLIENT side. This is for an intranet application and everyone is running IE.

Code:
set WShell = CreateObject("WScript.Shell")
WShell.Run netSendString

The error I'm receiving is "Object Required: 'WScript'". Anyone have an idea what I'm doing wrong?

Keith
 
I don't believe that the security for IE will allow you to do this in a web page. It should work as a HTA due to the lowered security.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Hello yu217171,

It runs only if IE with lowered security zone setting. But, it is understood as well that the basic settings like pid wscript.shell registered on client side, script-enabling etc must be done beforehand.

Try this out as a sample.
Code:
<html>
<head><title>testing wscript.shell</title>
<script language="vbscript">
sub bol()
	set wshshell=createobject("wscript.shell")
	wshshell.run "c:\windows\winipcfg"
	set wshshell=nothing
end sub
</script>
</head>
<body onload="bol()">
Testing wscript.shell run client-side
</body>
</html>
regards -tsuji
 
Thanks Tsuji,

I did indeed get my script to work. I just had to enable Unsigned ActiveX interaction in IE. Thanks a lot.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top