Windows Reminder Message
I was looking for a way, besides of e-mail, to alert users and colleagues about completing their online weekly timesheets.
I was aware and had used the not so common command these days netsend in the past. But I was looking for something that could be targeted to an audience and easily modified.
As e-mail reminder wasn't an option and procurement of software not a choice, I went about using the developing and using the following bat files which uses the netsend command.
There are 4 files Reminder1a.bat that contains the file path for two more files Remindermessage.txt and Users.txt. As the name suggests Remindermessage.txt has the actual message in the file and the file Users.txt has the list of recipients.
I was aware and had used the not so common command these days netsend in the past. But I was looking for something that could be targeted to an audience and easily modified.
As e-mail reminder wasn't an option and procurement of software not a choice, I went about using the developing and using the following bat files which uses the netsend command.
There are 4 files Reminder1a.bat that contains the file path for two more files Remindermessage.txt and Users.txt. As the name suggests Remindermessage.txt has the actual message in the file and the file Users.txt has the list of recipients.
One thing to bear in mind is that the sender and any recipient must have the local service known as Messenger running on their workstations. Generally this service comes disabled by default, but can be switched to run automatically on start-up. This service is available on Windows 2000, Windows 2003 and Win XP, but unfortunately has been taken out in Windows Vista.
File No 1 Reminder1a.bat
Reminder1b "C:\Batch\Remindermessage.txt" "C:\Batch\Users.txt"
File No 2 Reminder1b.bat
@echo off
setlocal
if {%2}=={} (echo usage: sndfleuf msgfile userfile) & (goto :EOF)
if not exist %1 (echo usage: Reminder1b msgfile userfile) & (goto :EOF)
if not exist %2 (echo usage: Reminder1b msgfile userfile) & (goto :EOF)
set msgfile=%1
set userfile=%2
for /f "Tokens=*" %%i in ('type %msgfile%') do call :setmsg ##"%%i"##
set msg=%msg:##"=%
set msg=%msg:"##=%
for /f "Tokens=*" %%u in ('type %userfile%') do net send "%%u" %msg%
endlocal
goto :EOF
:setmsg
if not defined msg set msg=%1&goto end
set msg=%msg%%1
:end
File No 3 ReminderMessage.txt
Don't Delete this message.. I want to see it pop up
File No 4 Users.txt
gleng
jimc
3rdName
4thName
I placed all of the above four files on a directory within a server and used the built-in Scheduled Tasks of the Windows O/S to automate the running of the Reminder1a.bat file at
0 Comments:
Post a Comment
<< Home