Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MESSAGE BOX FROM COMMAND PROMPT

Status
Not open for further replies.

si013

MIS
Jul 18, 2003
9
GB
HOW DO YOU MAKE A MESSAGE BOX POP UP WITH CERTAIN TEXT DISPLAYING FROM A .BAT FILE?

LIKE THE MSGBOX COMMAND IN VB?
 
Well, you could use the MsgBox function in a VBScript. Something like this:
Code:
On Error Resume Next
MsgBox WScript.Arguments.Unnamed.Item(0)


[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Depending on your environment, you may be able to create this batch:
Code:
@echo off
Net Send %COMPUTERNAME% %1
Then call it like this:
Code:
call MsgBox.bat "This is a test"

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
if your looking for just a message to pop up that could say anything and only have an OK prompt then you could use the "net send" command..you would just need to know the "who" to send it too...

example
net send (pc name) "Your shorts are too tight!"

if you dont know the "who" to send to there are (at least for me and how were are set up) two options...

if in DOS you type SET with no parameters it will display all the enviroment variables that are currently defined..
for me i could go two ways here...
we have an Eniv var set up for login name %username%
and we have Eniv var set up for the pc name %computername%
if you have neither of these (or anything like it)
then you might be able to (somehow) parse out who the person running the command is by using the NET NAME command..
if you do figure out how, please post with your solution.
Hope this helps
chris castelein
Shive-Hattery
Cedar Rapids, IA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top