PDA

View Full Version : Net Send in an HTML document


one-leg
08-04-2005, 07:56 PM
Hello,

Most of you probably know the "Net Send" feature in windows. Well, I would like to create an HTML document in which I would have 2 fields. One field to put the message and another to put my name (or whom ever is sending the message).

Then, I would like to have a SEND button that will send the message using "Net Send" to the people working in my group.

As an example, I would need to send the message to AA001234, AB005678, BC009012, CD003456 and DE007890.

Also, when the document will register the information entered for the message, I would like to automatically add, at the beggining of the message: "Hello all... Please read this note carefully". At the end of the message, I would like to have the person's name as entered in the field where it ask for the name...

I don't know if anyone can help me with this but a BIG THANKS in advance...

_Aerospace_Eng_
08-04-2005, 08:02 PM
This isn't html, I'm going to move this to windows administration. You are probably going to need someway to use the command prompt, and I think this will probably require something more intense than javascript, Visual Basic might be able to do this not sure.

one-leg
08-04-2005, 08:07 PM
Ok... thanks!!! Hopefully, someone will be able to help me out!!!

Horus_Kol
08-05-2005, 04:00 AM
PHP scripts can access programs and system commands:
http://uk2.php.net/function.exec

one-leg
08-08-2005, 01:23 PM
Hello again to all of you!!!

I was able to find an old version of a file someone had done for me... The only difference is that you have to select to whom you wanted to send the message. This time, I would like to enter a list of usernames and send the same text to everyone. Here is the HTML code used in the first version:

========================================

<html>
<head>
<title>Net send from HTML</title>
<script type="text/javascript">

var sh = new ActiveXObject('Shell.Application');

function NetSend(){
var netto = document.getElementById('netto').value;
var netsend = document.getElementById('netsend').value;
sh.ShellExecute('NET', 'SEND '+netto+' '+netsend+'. . . . . From: OneLeg');
}

window.onload = function(){
var q = location.href.substring((location.href.indexOf('?') + 1), location.href.length);
if(location.href.indexOf('?') >= 0 && q == 'popup'){
document.body.style.visibility = 'visible';
}
else{
window.open(location.href + '?popup', '', 'width=525,height=200');
}
}

</script>
</head>
<body style="visibility: hidden;">

<form action="" method="post" onsubmit="NetSend(); return false;">
To: <select id="netto">
<option value="aa001234">A-A</option>
<option value="bb001234">B-B</option>
<option value="cc001234">C-C</option>
<option value="dd001234">D-D</option>
<option value="ee001234">E-E</option>
<option value="ff001234">F-F</option>
</select><br>
Message: <textarea id="netsend" cols="60" rows="6"></textarea><br>
<input type="submit" value="Send">
</form>

</body>
</html>

========================================

Anyone knows what I need to change to be able to do what I would like to do???

Thanks!!!

one-leg
08-15-2005, 02:23 PM
Anyone got anything on this???

:rofl:

Horus_Kol
08-15-2005, 05:38 PM
sorry one-leg - but I think you're out of luck here - mostly people respond to a thread when they only have a valid response...

afterburn
08-22-2005, 08:17 AM
The options are the machine names

<option value="aa001234">A-A</option>
<option value="bb001234">B-B</option>
<option value="cc001234">C-C</option>
<option value="dd001234">D-D</option>
<option value="ee001234">E-E</option>
<option value="ff001234">F-F</option>


where "dd001234" is your local machine name or another on the local network.

one-leg
08-22-2005, 10:26 AM
aa001234
bb001234
cc001234
dd001234
ee001234

These are usernames...

afterburn
08-22-2005, 02:36 PM
or machine names; see how it works is that the netbios services register by user and by machine depending on the application needs.

for instances if you use the command
nbtstat -n

it will show you the names of the registered services, in net send it registers both, however using the name of the user might confuse it, and there is documentation to that affect where it would give the user the same message 2 or more times.

The actual name is encoded using at the byte level by taking and higher and lower 4 bits and adding 47 to them then concatening the result back as a string back and resulting in the mangled name that is boradcast on the mailbox addresses.

Messenger service registers both user and machine with the sufix byte of (03).

one-leg
08-24-2005, 09:00 AM
Hello,

The thing is that even if it's easier to enter the PC number, the users don't always sit at the same desks...

Basically, I would like the document to copy the info entered in the "text box" and put it into the net send command for each user... For example:

net send aa001234 'Text in the text box';
net send bb001234 'Text in the text box';
net send cc001234 'Text in the text box';
net send dd001234 'Text in the text box';
net send ee001234 'Text in the text box';

Thanks!!!

afterburn
08-24-2005, 09:52 AM
Ok then why don't you use that script. You will note that XP SP1 disabled the messenger service though.

I have written a component that can do that in C# however I am not willing to give it out at the current time. I might do it in the future. No the componenet does not use the native net send command, rather it implements it from the ground up, including querying the remote machine for existence of the messenger service running, that excepts in coming messages.

one-leg
08-24-2005, 10:05 AM
I don't know how to create an HTML document to run that script!!! This is the reason why I'm seeking help in this forum...

Technically, I just wanna use Notepad to enter some codes in order to do what I'm looking for!!!

Thanks!!!

afterburn
08-24-2005, 11:02 AM
after copying content into a file, you save the file from notepad .... to whatever.html
and then open the file in a browser.

one-leg
08-24-2005, 11:16 AM
That's the problem...

I don't just wanna use it only once... I wanna have an HTML document, with a text box in which I'll enter a text in it and once I click on SEND, I want it to send the info inserted in the text box to everyone in my team via net send.

Basically, I want to do something similar to what I was doing last year (see coding in a previous reply)... Except of selecting to whom I wanna send to message to, I want to send it to everyone!!!