Re: Using NET SEND for a pop-up box
- From: "Richard G. Harper" <rgharper@xxxxxxxxx>
- Date: Tue, 30 Jan 2007 16:25:40 -0500
I'm not surprised. NET SEND doesn't use DNS and at the time of login only
DNS can be known to be stable ... so ...
Why not use a batch file and some ECHO commands instead?
@echo off
echo "This is an important message!"
echo "If you read it you will know why"
pause
This batch/CMD file displays text in a window and waits for the user to
press a key to continue.
--
Richard G. Harper [MVP Shell/User] rgharper@xxxxxxxxx
* NEW! Catch my blog ... http://msmvps.com/blogs/rgharper/
* PLEASE post all messages and replies in the newsgroups
* The Website - http://rgharper.mvps.org/
* HELP us help YOU ... http://www.dts-l.org/goodpost.htm
"Neko-" <neko-@xxxxxxxxx> wrote in message
news:1170164772.682177.255150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On a request of one of our HR users I've been asked to investigate the
possibility to show a pop-up box during the loginscript to alert users
to certain important messages. Our environment exists primarily of a
Windows 2000/2003 AD, with the workstations being active under Windows
2000 SP4.
I've done a bit of testing and found that NET SEND <username>
"message" would suit our needs best. The loginscript has therefore
been appended with the following (broken up in 3 parts):
Net use L: \\server\netlogon
L:
CD\files
Sc.exe config "messenger" start= auto
C:
Net start messenger
Net use L: /delete
Net send %username% "A notification goes here"
The first part is using the SC command Microsoft released to make sure
the 'Messenger Service' is set to automatically start. This incase
it's disabled through some means.
The second part initiates the acual starting of the 'Messenger
Service' incase this has not yet been started. If it has, it'll
generate an error, but overall nothing to worry about.
The last bit uses the %username% variable (which contains the username
of the user) to initiate the command to send a message to the locally
logged on user.
Now running this batchfile manually on any PC results in it doing
exactly what we expect it to do. The user receives a pop-up box with
the notice just as requested. When running this from the loginscript
however, it fails.
The last command is filled in with the correct username (this has been
verified by pausing the script and checking the actual command
syntaxes given), and then returns an error:
An error occurred while sending a message to <username>.
The message alias could not be found on the network.
More help is available by typing NET HELPMSG 2273.
What I have found is that this means the username is not yet known on
the network, eventho the user has just logged in and authenticated.
More mind-boggeling is the fact that after logging in (and the failure
exhibiting itself) and then running a manual session of the same login-
script results in it doing exactly what we would expect it to do,
namely pop-up the box.
Anyone have any thoughts on this?
Thanks in advance,
J. van Doornik
.
- References:
- Using NET SEND for a pop-up box
- From: Neko-
- Using NET SEND for a pop-up box
- Prev by Date: Re: same nic different partition
- Next by Date: Re: Using NET SEND for a pop-up box
- Previous by thread: Using NET SEND for a pop-up box
- Next by thread: Re: Using NET SEND for a pop-up box
- Index(es):
Relevant Pages
|