Windows 10

Batch File To Display Popup Message in Windows 10

In this quick tutorial, we’ll walk through how to create a simple batch file to display a popup message in Windows 10 using the built-in msg command.

The msg command is a legacy tool primarily used to send messages to users on a Remote Desktop Session Host (formerly known as Terminal Server). However, it can also be used locally to display popup-style messages, which is useful for administrators, help desk scripts, or scheduled reminders.
 

🛠 Syntax:
msg <username | sessionname | sessionid | *> [/time:<seconds>] [message]
  • * — Sends the message to all users currently logged into the system.
  • /time:<seconds> — Specifies the number of seconds the message will remain on the screen. If omitted, the default is 60 seconds.
  • message — The text you want to display.
Note: This command may not work on Home editions of Windows, and UAC (User Account Control) or group policy restrictions might prevent its execution depending on your environment.

 
 

📌 Example 1: Send a basic message to all users
msg *  We will meet at 1:00 pm today

This command sends a message to all users on the system.
 

 

📌 Example 2: Send a message with a 10-second timeout
msg * /time:10 We will meet at 1:00 pm today

This displays the message for 10 seconds before automatically closing.
 
 

📝 Creating a Batch File

To automate this process, you can wrap the command in a batch file:

@Echo off

msg *  We will meet at 1:00 pm today
  • Open Notepad.
  • Paste the code above.
  • Save the file with a .bat extension, e.g., popupMessage.bat.
  • Right-click the file and select Run as administrator (required in many cases for the message to display properly).

You can also run the script via CMD as below:
 

 

✅ That’s It!

You now have a working batch script that can send popup messages to users in Windows 10. This technique can be integrated into system maintenance scripts or used to deliver alerts in shared computing environments.
 

🚀 Boost your productivity with the best AI toolsTry them

 

Leave a Reply

Your email address will not be published. Required fields are marked *