Link to home
Start Free TrialLog in
Avatar of gisvpn
gisvpnFlag for United States of America

asked on

Display a Message

I would like to diplay a message via a Batch file. Ideally i would like this message to appear in a dialog box or something similar as oppsed to using the CMD window and when they press a key it will continue executing the batch file.

Does anyone know if this is possible ?

Many thanks

Ollie
Avatar of Kavar
Kavar

I think the easiest way would be to create a vbscript that does the messaging for you....

*********Begin VBS********
if wscript.arguments.count then
   msgbox wscript.arguments(0)
end if
*********end vbs**********

save that as msg.vbs

to call from your bat file....

use Start /wait msg.vbs "Hi there"

the user has to click okay for batch to continue
Let me know if you want something different.
Avatar of gisvpn

ASKER

Hello..

Thanks for your post.. Sounds like a good idea..

When i do this and call it from the batch file its opens the text editor to edit the msg.vbs.. am i doing something wrong :)
yes.... you have vbs registered with notepad...

either call the vbs with

start /wait %systemroot%\system32\cscript.exe msg.vbs "message"

or register vbs with cscript
Avatar of gisvpn

ASKER

Hey thank you thats great.. will this work for Windows XP | 2000 | 9x | NT ?

Many thanks
Avatar of gisvpn

ASKER

Also is it possible for the message to timeout and continue anyway if no one presses ok ?

Thank you again !!
ASKER CERTIFIED SOLUTION
Avatar of Kavar
Kavar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gisvpn

ASKER

You are good !

One more 2  quick questions :

Is it possible to add the time in the dialog box ( i.e. the time left until it continues )

Would it be possible to allow someone to PAUSE the count down ? I.e add a PAUSE button and when they click it, it displays PAUSE in the same Dialog box.

THANK YOU !
(".)

if you want to change it to an IE based window yes (much more baggage there)
otherwise no
Avatar of gisvpn

ASKER

ok many thanks...  if i set up another question could you help me with a IE based one ?
sure