Forum Moderators: open
Can anyone please tell me how i can send a net send message to an IP address using ASP or ASPX? i know it can be done as i've seend some sites using it.
Many thanx in advanced.
Thanx
Laura
<%@ LANGUAGE = VBScript %>
<%
' Sending a message using NET SEND on a Windows NT network
' Send a message to any user on a network using your browser (!)
'Checking for all necessary variables.
Msg = Request.Form("Msg")
NamUsr = TRIM(Request.Form("NamUsr"))
Computer = Request.ServerVariables("REMOTE_ADDR")
if Msg <> "" AND NamUsr <> "" THEN %>
<% Response.Write "<P>Sending message to "
Response.Write "<B>" & NamUsr & "</B>: "
Response.Write "This message " & Msg & "<br>"
Set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "%comspec% /c net send " & NamUsr & " [FROM: " & Computer & "] " & Msg
ELSE
'Displaying the form %>
<FORM NAME="Vorm" METHOD="Post">
To: <INPUT TYPE="text" NAME="NamUsr" SIZE="20" value="pc111"><BR>
Message: <textarea name="Msg" cols="40" rows="6"></textarea><BR>
<INPUT TYPE="submit" VALUE="Send Message">
</FORM>
<% END IF
%>
I tried you're script but i get this error msg!
All my rights seems ok!
You're script seems to run directly from the web server,but can it be done localy?
Thanks for you're help!
sending message to p0515374: This message test
Microsoft VBScript runtime error '800a0046'
Permission denied
/qmanager/netsend.asp, line 35
esplendidos: I tried sjgould's script too and got the same error.
sjgould: do we need to change permissions for some files? I am using windows server 2003, IIS 6. Is that script supposed to work over the internet as well as intranet?
Thanks,
Ryan