AutoHotkey Community

It is currently May 27th, 2012, 8:34 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: April 14th, 2006, 7:50 am 
Offline

Joined: October 10th, 2005, 10:44 am
Posts: 299
Location: Germany
Hey guys,

I woke up at 0600h this morning and couldn't sleep anymore ("prä-senile Bettflucht" - don't think that translates into English :wink: ).
So I went to write a little batch file to entertain me at work, where we got Windows 2000 (as well as ball/non-optical mice and constantly crashing Outlook 2000 :roll: ) and the messenger service is not turned off.
Anyways, here's a simple batch file to send messages to other users in the network:
Code:
@ECHO OFF

:main
   REM CLS
   ECHO.
   ECHO --------------------------------------------------
   ECHO.
   ECHO Net Send Messenger
   ECHO.
   ECHO Enter recipient (User) and text (Message) to send a message.
   ECHO Leave the User blank to retain the previous recipient.
   ECHO Enter "exit" as User to terminate the messenger.
   ECHO.
   SET /P user=User:
   IF %user% == exit GOTO quit
   SET /P text=Message:
   GOTO sendMsg

:sendMsg
   ECHO.
   ECHO Sending "%text%" to "%user%"
   NET SEND %user% %text% - %username%
   REM PAUSE
   GOTO main

:quit
This code is loosely based on deckkeeper's example.

There's probably a billion similar - and better - scripts out there (especially because I hadn't used batch files in ages), but it gave me something to do...


PS: I just noticed that the line break char for the NET SEND command can't be pasted into this text field. Check out this site and copy the square-like char into this line:
NET SEND %user% %text%[line break] - %username%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2006, 8:51 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Ähnliche habe ich auch (post-senile Bettflucht). Warum schreibst du das als ein Batch Datei? AHK kann das doch besser.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2006, 11:16 pm 
Offline

Joined: October 10th, 2005, 10:44 am
Posts: 299
Location: Germany
Laszlo, I wasn't aware that you speak German - or was I? Guess I can add "pre-senile memory loss" to the list. :oops:
As for the "bed desertion"; sleep is overrated anyway...

Anyways, of course AHK can do that better than my crappy batch script. But it just 'evolved' somehow when I stumbled across that example, that's why I continued down the batch path.
Plus, as I said, it was just a way to entertain myself, and it was kinda fun goin' old school again (at least that's what batch files are to me - the older generation might prefer to think of something like FORTRAN here)... :wink:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group