views:

530

answers:

2

I want to realize a simple confirmation/alert box which can be called using a Windows XP/Vista batch script by CLI.

The standard alert box seems to be blocking which means that the whole batch script will stop at the time of the alert window call which is NOT what I want.

If it needs to be coded, please supply an example or documentation. Language can be anything that is compileable without requiring a virtual machine in between.

+3  A: 
start MessageBox.vbs

...where MessageBox.vbs contains a call to the MsgBox function.

Roger Lipscombe
wow, now that was easy :) thank you!
+2  A: 

You can use the msg tool:

Send a message to a user.

MSG {username | sessionname | sessionid | @filename | *}
    [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]

  username            Identifies the specified username.
  sessionname         The name of the session.
  sessionid           The ID of the session.
  @filename           Identifies a file containing a list of usernames,
                      sessionnames, and sessionids to send the message to.
  *                   Send message to all sessions on specified server.
  /SERVER:servername  server to contact (default is current).
  /TIME:seconds       Time delay to wait for receiver to acknowledge msg.
  /V                  Display information about actions being performed.
  /W                  Wait for response from user, useful with /V.
  message             Message to send.  If none specified, prompts for it
                      or reads from stdin.

The call

msg * Some text

doesn't block. It also has the nice capability of closing the message box again after a set amount of time if required.

On a side note, though, you shouldn't really use those things. Monologs (like message boxes with exactly an OK button) have an information efficiency of 0 % (cf. Jef Raskin: The Humane Interface. Section 4–3: Measurement of Interface Efficiency or Aza Raskin: Monolog Boxes and Transparent Messages or Aza Raskin: Know When to Stop Designing, Quantitatively).

Joey