Search Tools Links Login

Net Message


To send a Net Message to a user/computer from the web

Original Author: Stephen King

Inputs

computer name

Assumptions

I built this to send messages to computer users from a listing of all the computers on the network..can be useful for many things..or just playing with your friends. very simple

Returns

message

Side Affects

none

API Declarations

free as a bird

Code

<%@ Language=VBScript %>



Send Net Message



<% if request("msg") = "" and Request.form("txtmsg") = "" and Request.form("txtmsg2") = "" then
'detemine if any messages are present; display send link
%>
Send Message to a computer  
<%
else
if Request.Form("txtmsg") <> "" or Request.form("txtmsg2") <> "" then 'make sure a message has been entered

if Request("txtcomputer") = "" then 'direct from the listing, not the form
if request("computer") <> "" then
Response.Write "

Message being sent to "
Response.Write "" & Request("computer") & ""
Response.Write ": "
Response.Write Request.Form("txtmsg") & "

"
set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "%comspec% /c net send " & Request("computer") & " " & Request.Form("txtmsg") 'run the command
else
Response.Write "No computer entered"
end if

else 'the form was used to enter a computer name
response.Write "

Message being sent to "
Response.Write "" & Request.Form("txtcomputer") & ""
Response.Write ": "
Response.Write Request.Form("txtmsg2") & "

"
set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "%comspec% /c net send " & Request.Form("txtcomputer") & " " & Request.Form("txtmsg2")
end if
elseif request("msg") = "send" then 'draw form for sending message
if Request("computer") <> "" then 'computer from a listing
Response.Write "
"
Response.Write "

Type in the message you want to send to " & request("computer")
Response.Write ""
Response.Write ""
Response.Write "

"
Response.Write "

OR
" 'give both options
end if

Response.Write "
"
Response.Write "

Type in the message you want to send to "
'draw a form table
Response.Write "

"
Response.Write ""
Response.Write ""
Response.Write ""
Response.Write ""
Response.Write ""
Response.Write ""
Response.Write "
Computer Name
Message
"
Response.Write ""
Response.Write "
"
end if
end if
%>


 




About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 109 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.