View Full Version : Javascript function that utilizes "Net Send"?

08-05-2002, 09:20 PM
What I'd like to do is have a link on a desktop so that when someone opens it, all they have to do is type the computer name and the message and hit a send button. The reason for this is the systems are locked down so nobody can get to the command prompt or the run line and I'd like to be able to give them access to Net Send without giving them any other extra access.
I know this can be done with javascript but I don't know enough to get the function to work.
Can someone help me out here?

Thanks everyone.

08-05-2002, 09:39 PM
unfortunately this can't be done in javascript (at least as far as I know. I did something like this).

I used cold fusion to do this exact thing because... well because im too lazy to goto the command line and type it all out. :)

You need some way to execute an external program.

CFM Code below...

<cfif IsDefined("msg") AND #msg# GT '' AND IsDefined("user") AND #user# GT ''>
<CFEXECUTE NAME="c:\winnt\system32\net.exe"
arguments=" send #user# #msg#">
<cflocation url="netsend.cfm">
<form action="netsend.cfm" method="post">
User: <input type="text" name="user" value="eblake"><br>
Msg : <input type="text" name="msg"><br>
<input type="submit">

Just calls itself with the variables it needs to process.
Hope this helps some.

08-05-2002, 10:06 PM
I'm pretty sure it can be done.
There is an intranet site here that has exactly what I'm trying to do.
I hit view source and he's got a function called "sendmessage"
The function isn't define in the source on that page though and I don't know enough about html or web design to find it.

08-05-2002, 11:43 PM
look for something like <script src="xxxxx.js"> then try looking at that file. If they have a way to do it with Javascript i would be interested in seeing it.

08-06-2002, 12:12 AM
Using ActiveX and WSH, you can run exe files on a local computer... as long as the user allows ActiveX to run.

You can do the same in NS3+ (maybe 4+?) by enabling privileges in netscape.security.privilegeManager and running an appropriate Java method through LiveConnect.

08-06-2002, 04:58 PM
The src line was this

I don't know anyting about activex or wmh or cold fusion for that matter. Sorry.

What would an inc file be?

08-06-2002, 06:53 PM
An .inc file could contain anything, but in your case it's most likely that it contains valid js code. Have you tried opening techtool.inc in your browser, that should give you it's contents either directly or as a download.

Why don't you ask the maintainer of this script, since it is on your intranet? They should know best what parts where used to make it run.

08-06-2002, 10:05 PM
That would seem like the easy answer Mo, I tried emailing the guy and asking for a copy of it, but he hasn't responded to that or my voice mail.
I did open that inc file though.

function sendmessage() {

open ("netsend.asp?host=" + document.runquery.sendhost.value + " " + document.runquery.sendtext.value,"","alwaysRaised,dependent,height=50,width=300")

That means it's done with server script right? the asp file?
Is there a way for me to get a copy of that file or code if its in an asp file?

08-07-2002, 12:59 AM
unfortunately if you dont have direct access to the file i dont think there is anyway to get the actual source for the asp file itself. you could try running that asp file directly and see if you can view source but I dont know if they would be much help.

Maybe a mod can move this to the asp forum and they can tell you how to run an external program with asp. My asp skills are sub par. :(

08-07-2002, 03:26 AM
you can download free asp component that can run dos & windows apps. they called it AspExec. you can see it at http://www.serverobjects.com/products.htm at the bottom part.