Introduction: NETsend With VBScripting
Ok so it's not totally with VBScripting, but I think that VBScripting InputBoxes and Msgboxes look much more user friendly than inputting into a cmd window.
Oh and btw, Please don't write "MUCH EASIER WAY..."
Cause yes we all know that you can open up cmd and type "Net send computername yourmessagehere"
This is just a more user friendly way of doing it.
Disclaimer
I am totally not responsible if anything goes wrong with this program, or if the program is misused in ANY way.
Now we've got that out the way, let's move on -->
Step 1: Let's Get Started
Firstly, I'll show you the script and on the next page i'll explain what each bit means.
dim Target
Target=InputBox("Enter Target Computer: ","Carrier Pigeon v1.7 (TheKnight)")
If Target="" Then
WScript.Quit
End IF
dim begin
begin=MsgBox ("Begin conversation with " & target & "?",36,"Carrier Pigeon v1.7")
If begin = vbNo Then
WScript.Quit
End If
dim message
message="0"
Do Until message=""
message=InputBox("Enter Message: " & vbcr & vbcr + _
"No Value sends a blank message" & vbcr + _
"Press Cancel or Alt+F4 to close the window","" & Target," ",13500,100)
Set fs=CreateObject("Scripting.FileSystemObject")
strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~msngr.bat")
strFileName = fs.GetAbsolutePathName(strFileName)
Set ts = fs.OpenTextFile(strFileName, 2, True)
ts.WriteLine "@echo off"
ts.WriteLine "set message=" & message
ts.WriteLine "set target=" & Target
ts.WriteLine "net send %Target% %message%"
ts.Close
dim shell
set shell=createobject("wscript.shell")
shell.Run "~msngr.bat",2
Loop
Step 2: So Let's Explain...
The code on the previous page is shown below with some annotations, if your copying and pasting it into word, please do it on the previous page.
Ok, This first bit opens up the box that asks for the name of the computer you want to start a conversation with. The "If Target" part tells the computer to end the program if the user press' cancel or leaves the input field blank.
dim Target
Target=InputBox("Enter Target Computer: ","Carrier Pigeon v1.7 (TheKnight)")
If Target="" Then
WScript.Quit
End IF
This second bit relays the input that the user did in the previous step, for example if the user input the target computer as: 'The_Pentagon' then this message relays one that says "Start conversation with The_Pentagon?". Same deal as above, if the user press' no, then the operation will terminate.
dim begin
begin=MsgBox ("Begin conversation with " & target & "?",36,"Carrier Pigeon v1.7")
If begin = vbNo Then
WScript.Quit
End If
This next bit is the part that took me LONG to write. It basically creates a batch file and calls it "~msngr.bat". It then writes the correct commands to it for it to initiate NET send.
dim message
message="0"
Do Until message=""
message=InputBox("Enter Message: " & vbcr & vbcr + _
"No Value sends a blank message" & vbcr + _
"Press Cancel or Alt+F4 to close the window","" & Target," ",13500,100)
Set fs=CreateObject("Scripting.FileSystemObject")
strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~msngr.bat")
strFileName = fs.GetAbsolutePathName(strFileName)
Set ts = fs.OpenTextFile(strFileName, 2, True)
ts.WriteLine "@echo off"
ts.WriteLine "set message=" & message
ts.WriteLine "set target=" & Target
ts.WriteLine "net send %Target% %message%"
ts.Close
This then runs the batch file, with the "2" making sure it runs in a minimized window and then closes. This makes it look a bit more professional.
dim shell
set shell=createobject("wscript.shell")
shell.Run "~msngr.bat",2
Loop
Those last two paragraphs of commands are Looped. This allows the user to keep the message window open, and send multiple messages until the user press' cancel and decides to close the program.
Step 3: Bear With Me!
Ok, I know that was alot to take in. But i'm probably going to submit a few new instructables to the site for simple VBScripting, and more advanced VBScripting if enough people comment asking for it.
So now to save the file!
press save, make sure to make the file extension ".vbs"
I know it was alot to take in but i'll explain what happens if the file is used correctly:
Firstly you'll get a prompt asking for the target computer
Next they'll be a message making sure you want to start a conversation with this computer.
If you clicked 'Yes' then an input box should appear (in the top right of your screen, so you can continue with what you want to do) asking you to input the message.
Once a message is input and 'OK' is clicked, then a cmd window should spring out along your toolbar and then disappear, this was the batch file sending the message.
If your friend (or enemy) has this same program installed on their computer, or is nifty with NET send, then you should get a reply back!
Step 4: One Last Thing Before You Go NET Sending Everywhere!
One last little message: THIS WON'T WORK ON VISTA!
The NET send command was abolished for Vista due to security reasons, therefore will only work on Windows operating systems before that.
But as some of you may have noticed, I have written this program on Vista! Therefore IN THEORY it works. However please return with feedback on whether it is successful or not.
Thanks
TheKnight
P.S. Incase your too lazy for words, the file is below
Save it in it's own folder, so that it and "~msngr.bat" can have some alone time...
14 Comments
13 years ago on Introduction
This is a great instructable and it works for me, but how can i get so when I recieve a message I get an alarm or a tone telling me I have a message.
13 years ago on Step 4
nice work dude!
13 years ago on Introduction
Wow, we had almost the same idea. I made mine in vb.net and my friends and I use it at school.
http://t3hw0n.wildspad.com/Netsend.NET.exe
Reply 13 years ago on Introduction
dead link
Reply 13 years ago on Introduction
zachperrault.com/downloads/Netsend.NET.exe
14 years ago on Introduction
Hey how do i figure out my 'friends' computer's name? like do you mean it's ip? cause if your on one big network (say a school computer) then we all have the same ip or do u mean the actual computer name itself?
Reply 13 years ago on Introduction
I pinged my mum to find out her IP
cmd.exe ping "computer name or site"
i tryed google but no one sends back googles ip is 66.102.11.99
Reply 13 years ago on Introduction
At schools you actually do have different IPs. Theyre almost the same, but not. Just look at the IPCONFIG information and you will find everything that you need, like the the ipv4 address, the mac address, ect.
Reply 13 years ago on Introduction
And the account name sometimes works too.
Reply 14 years ago on Introduction
I know what you mean, and you're kind of right thinking this. In my college, we all have individual accounts. Our username is what I use to find the person. E.g. If my friend was called Jeff Jones, and his username was jones29jeff, then i would type in "jones29jeff", if he was then logged in in another part of the network, the message can be sent. Hope this helped :-)
Reply 14 years ago on Introduction
ok thanks man ya i'll try that
13 years ago on Introduction
do you enter the targets ip or username?
Reply 13 years ago on Introduction
It depends what type of network you're on, for WLAN, use the username. For WAN use the IP
14 years ago on Introduction
Seems easy. If this functions, this is great!!!