Skip to content
August 25, 2008 / technocrawl

Chat From CMD Prompt

Here is a simple batch program that you can use to chat in a networked environment using command prompt….

1. Open up a notepad.

2. Copy and paste the following code.

3. Save it with the extension .bat.

4. Execute the file.

@echo off
:A
Cls
echo MESSENGER
set /p n=User:
set /p m=Message:
net send %n% %m%
Pause
Goto A

5. You have to specify the IP Address or hostname of the person whom you want to chat with, when it prompts for User.

6. You have to type the message and hit enter when it prompts you for message.

7. That’s it the message is now sent to the destination.

Advertisements

One Comment

Leave a Comment
  1. casperisl / Aug 3 2009 7:51 pm

    If you want a really cool messenger… here’s on I made for fun. Just copy it to a .txt file, change the variables, and save it as a .bat file. Enjoy…
    copy:
    @ echo off

    Change only these three variables below… unless you
    know what you’re doing (By the way, user means person
    recieving your messages). Also, this will only work
    within networks.
    cls

    set DEFAULTUSER= 192.168.1.46
    set DEFAULTUSERNAME= CARLOUS
    set PASSWORD= 1234

    :PASSWORD
    echo Login
    set /p n=Password:
    if %n% NEQ %PASSWORD% (goto :INCORRECT)
    echo Password Accepted
    @ping 127.0.0.1 -n 2 -w 1000 > nul
    @ping 127.0.0.1 -n %1% -w 1000> nul
    cls

    :DEFAULTMESSENGER
    echo CRAZY GANGSTA MESSENGER
    echo type; “/exit” to exit
    echo “/dif.user” to send to another IP
    echo “/ipconfig” to find out your IP
    echo “/clear”to erase log
    echo “/def.user” to send to default user
    :SEPERATOR
    echo To %DEFAULTUSERNAME%
    set /p m= Message:
    if %m% EQU /dif.user (goto :DIFUSER)
    if %m% EQU /ipconfig (goto :IPCONFIG1)
    if %m% EQU /def.user (goto :SEPERATOR)
    if %m% EQU /clear (goto :CLEAR1)
    if %m% EQU /ipconfig.all (goto :IPCONFIGALL1)
    if %m% EQU /ipconfig_all (goto :IPCONFIGALL1)
    if %m% EQU /ipconfig-all (goto :IPCONFIGALL1)
    if %m% EQU /ipconfig/all (goto :IPCONFIGALL1)
    if %m% NEQ /exit (goto :SEND)
    cls
    echo Disconnected
    @ping 127.0.0.1 -n 2 -w 1000 > nul
    @ping 127.0.0.1 -n %1% -w 1000> nul
    (:eof)

    :SEND
    echo sending…
    net send %DEFAULTUSER% %m%
    Goto :SEPERATOR

    :INCORRECT
    echo Password “%n%” Incorrect
    @ping 127.0.0.1 -n 2 -w 1000 > nul
    @ping 127.0.0.1 -n %1% -w 1000> nul
    @ping 127.0.0.1 -n 2 -w 1000 > nul
    @ping 127.0.0.1 -n %1% -w 1000> nul
    cls
    Goto :PASSWORD

    :DIFUSER
    set /p u=User:
    :USERMESSENGER
    echo To %u%
    set /p nm=Message:
    if %nm% EQU /dif.user (goto :DIFUSER)
    if %nm% EQU /ipconfig (goto :IPCONFIG2)
    if %nm% EQU /def.user (goto :SEPERATOR)
    if %nm% EQU /clear (goto :CLEAR2)
    if %nm% EQU /ipconfig.all (goto :IPCONFIGALL2)
    if %nm% EQU /ipconfig_all (goto :IPCONFIGALL2)
    if %nm% EQU /ipconfig-all (goto :IPCONFIGALL2)
    if %nm% EQU /ipconfig/all (goto :IPCONFIGALL2)
    if %nm% NEQ /exit (goto :USERSEND)
    cls
    echo Disconnected
    @ping 127.0.0.1 -n 2 -w 1000 > nul
    @ping 127.0.0.1 -n %1% -w 1000> nul
    (:eof)

    :USERSEND
    echo sending…
    net send %u% %nm%
    Goto :USERMESSENGER

    :IPCONFIG1
    ipconfig
    Pause
    Goto :SEPERATOR

    :IPCONFIGALL1
    ipconfig all
    pause
    cls
    Goto :SEPERATOR

    :IPCONFIG2
    ipconfig
    Pause
    Goto :USERMESSENGER

    :IPCONFIGALL2
    ipconfig all
    pause
    cls
    Goto :USERMESSENGER

    :CLEAR1
    cls
    Goto :DEFAULTMESSENGER

    :CLEAR2
    cls
    echo CRAZY GANGSTA MESSENGER
    echo type; “/exit” to exit
    echo “/dif.user” to send to another IP
    echo “/ipconfig” to find out your ip
    echo “/clear”to erase log
    echo “/def.user” to send to default user
    Goto :USERMESSENGER

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: