Net Message
Posted: 2002-06-01
By: ArchiveBot
Viewed: 63
Filed Under:
No attachments for this post
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
Message being sent to " Message being sent to " <%@ Language=VBScript %>
<% 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 "
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 "
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 "
OR
" 'give both options
end if
Response.Write ""
end if
end if
%>
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.