Sign in with
Sign up | Sign in
Your question

Pop-up window from command-line

Last response: in Windows 2000/NT
Share
Anonymous
April 21, 2005 12:49:46 PM

Archived from groups: microsoft.public.win2000.general (More info?)

I would like to pop up a window with a message from a command line
(e.g. BAT file).

If my computer is on a network, this command line works:

net send mymachine Hello World!

where mymachine is the network name of my own machine.

But this only works if my machine is on a network. Can anyone suggest
a technique that would work on a stand-alone machine as well?

- Rich
Anonymous
April 21, 2005 3:55:05 PM

Archived from groups: microsoft.public.win2000.general (More info?)

This should work regardless of whether you have a network connection. The
net send relies only the messenger service running. You should be able to
unplug your network cable and net send yourself just fine.

I suggest that you net send LOCALHOST or %COMPUTERNAME% instead of
hard-coding your computername in the .bat file though.

Ray at work

"Rich Pasco" <richp1234@hotmail.com> wrote in message
news:udwrAnoRFHA.3336@TK2MSFTNGP10.phx.gbl...
> I would like to pop up a window with a message from a command line
> (e.g. BAT file).
>
> If my computer is on a network, this command line works:
>
> net send mymachine Hello World!
>
> where mymachine is the network name of my own machine.
>
> But this only works if my machine is on a network. Can anyone suggest
> a technique that would work on a stand-alone machine as well?
>
> - Rich
Anonymous
April 21, 2005 3:55:06 PM

Archived from groups: microsoft.public.win2000.general (More info?)

Ray, thank you.

It may work if I unplug my network *cable* but it doesn't work if I
unplug my network *card* (which I often do on my laptop).

I tried LOCALHOST and it doesn't work at all (even with the network
active). I get:

An error occurred while sending a message to LOCALHOST.
The message alias could not be found on the network.
More help is available by typing NET HELPMSG 2273.

Of course %computername% is resolved by the command shell and is
equivalent to what I was doing. That is a good idea.

- Rich


Ray Costanzo [MVP] wrote:

> This should work regardless of whether you have a network connection. The
> net send relies only the messenger service running. You should be able to
> unplug your network cable and net send yourself just fine.
>
> I suggest that you net send LOCALHOST or %COMPUTERNAME% instead of
> hard-coding your computername in the .bat file though.
>
> Ray at work
>
> "Rich Pasco" <richp1234@hotmail.com> wrote in message
> news:udwrAnoRFHA.3336@TK2MSFTNGP10.phx.gbl...
>> I would like to pop up a window with a message from a command line
>> (e.g. BAT file).
>>
>> If my computer is on a network, this command line works:
>>
>> net send mymachine Hello World!
>>
>> where mymachine is the network name of my own machine.
>>
>> But this only works if my machine is on a network. Can anyone suggest
>> a technique that would work on a stand-alone machine as well?
>>
>> - Rich
>
>
Related resources
Anonymous
April 21, 2005 6:06:32 PM

Archived from groups: microsoft.public.win2000.general (More info?)

Is your messenger service running? Try this:

1. At the command prompt, enter "net start messenger"
2. Unplug your network card and wait 30 seconds for good measure
3. Again, enter "net start messenger"

Did the messenger service start either time?

Another option is to do something like:

cscript c:\msg.vbs "Hi there."

Where the contents of msg.vbs are:

On Error Resume Next
Msgbox WScript.Arguments(0)

Ray at work

"Rich Pasco" <richp1234@hotmail.com> wrote in message
news:uhgZNyoRFHA.3096@TK2MSFTNGP12.phx.gbl...
> Ray, thank you.
>
> It may work if I unplug my network *cable* but it doesn't work if I
> unplug my network *card* (which I often do on my laptop).
>
> I tried LOCALHOST and it doesn't work at all (even with the network
> active). I get:
>
> An error occurred while sending a message to LOCALHOST.
> The message alias could not be found on the network.
> More help is available by typing NET HELPMSG 2273.
>
> Of course %computername% is resolved by the command shell and is
> equivalent to what I was doing. That is a good idea.
>
> - Rich
>
>
> Ray Costanzo [MVP] wrote:
>
> > This should work regardless of whether you have a network connection.
The
> > net send relies only the messenger service running. You should be able
to
> > unplug your network cable and net send yourself just fine.
> >
> > I suggest that you net send LOCALHOST or %COMPUTERNAME% instead of
> > hard-coding your computername in the .bat file though.
> >
> > Ray at work
> >
> > "Rich Pasco" <richp1234@hotmail.com> wrote in message
> > news:udwrAnoRFHA.3336@TK2MSFTNGP10.phx.gbl...
> >> I would like to pop up a window with a message from a command line
> >> (e.g. BAT file).
> >>
> >> If my computer is on a network, this command line works:
> >>
> >> net send mymachine Hello World!
> >>
> >> where mymachine is the network name of my own machine.
> >>
> >> But this only works if my machine is on a network. Can anyone suggest
> >> a technique that would work on a stand-alone machine as well?
> >>
> >> - Rich
> >
> >
Anonymous
April 21, 2005 11:00:36 PM

Archived from groups: microsoft.public.win2000.general (More info?)

On Thu, 21 Apr 2005 08:49:46 -0700, Rich Pasco <richp1234@hotmail.com>
wrote:

>I would like to pop up a window with a message from a command line
>(e.g. BAT file).

echo msgbox "Message!">%temp%\message.vbs
%temp%\message.vbs
del %temp%\message.vbs

--
RoRo
Anonymous
April 23, 2005 12:37:04 PM

Archived from groups: microsoft.public.win2000.general (More info?)

With my network card removed, I could not send a message to
myself, even though the messenger service was still running:

C:\>net send %computername% hello
An error occurred while sending a message to PASCO-LAPTOP.
The message alias could not be found on the network.
More help is available by typing NET HELPMSG 2273.

C:\>net start messenger
The requested service has already been started.
More help is available by typing NET HELPMSG 2182.

C:\>net send %computername% hello
An error occurred while sending a message to PASCO-LAPTOP.
The message alias could not be found on the network.
More help is available by typing NET HELPMSG 2273.

Of course with the network card installed the same command
results in the pop-up window as desired.

I really like the VBScript solution better. It works OK even
in the absence of the network card. However, it still doesn't
solve my whole problem. The context in which I was planning
to use it is as follows:

at 8:43 /interactive c:\test\msg.vbs "Hello World"

In this context, the script msg.vbs cannot find its command-line
argument "Hello World." If I disable the "On Error Resume Next"
statement it gives a "Subscript out of range" error; otherise
it exits silently.

- Rich

Ray Costanzo [MVP] wrote:

> Is your messenger service running? Try this:
>
> 1. At the command prompt, enter "net start messenger"
> 2. Unplug your network card and wait 30 seconds for good measure
> 3. Again, enter "net start messenger"
>
> Did the messenger service start either time?
>
> Another option is to do something like:
>
> cscript c:\msg.vbs "Hi there."
>
> Where the contents of msg.vbs are:
>
> On Error Resume Next
> Msgbox WScript.Arguments(0)
>
> Ray at work
>
> "Rich Pasco" <richp1234@hotmail.com> wrote in message
> news:uhgZNyoRFHA.3096@TK2MSFTNGP12.phx.gbl...
>> Ray, thank you.
>>
>> It may work if I unplug my network *cable* but it doesn't work if I
>> unplug my network *card* (which I often do on my laptop).
>>
>> I tried LOCALHOST and it doesn't work at all (even with the network
>> active). I get:
>>
>> An error occurred while sending a message to LOCALHOST.
>> The message alias could not be found on the network.
>> More help is available by typing NET HELPMSG 2273.
>>
>> Of course %computername% is resolved by the command shell and is
>> equivalent to what I was doing. That is a good idea.
>>
>> - Rich
>>
>>
>> Ray Costanzo [MVP] wrote:
>>
>> > This should work regardless of whether you have a network connection.
> The
>> > net send relies only the messenger service running. You should be able
> to
>> > unplug your network cable and net send yourself just fine.
>> >
>> > I suggest that you net send LOCALHOST or %COMPUTERNAME% instead of
>> > hard-coding your computername in the .bat file though.
>> >
>> > Ray at work
>> >
>> > "Rich Pasco" <richp1234@hotmail.com> wrote in message
>> > news:udwrAnoRFHA.3336@TK2MSFTNGP10.phx.gbl...
>> >> I would like to pop up a window with a message from a command line
>> >> (e.g. BAT file).
>> >>
>> >> If my computer is on a network, this command line works:
>> >>
>> >> net send mymachine Hello World!
>> >>
>> >> where mymachine is the network name of my own machine.
>> >>
>> >> But this only works if my machine is on a network. Can anyone suggest
>> >> a technique that would work on a stand-alone machine as well?
>> >>
>> >> - Rich
>> >
>> >
>
>
Anonymous
April 24, 2005 12:37:43 AM

Archived from groups: microsoft.public.win2000.general (More info?)

On Sat, 23 Apr 2005 08:37:04 -0700, Rich Pasco <richp1234@hotmail.com>
wrote:

>at 8:43 /interactive c:\test\msg.vbs "Hello World"

I cannot explain why this fails, but this workaround seems to work, at
least on my XP machine:

at 8:43 /interactive wscript c:\test\msg.vbs "Hello World"

--
RoRo
!