Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4014936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:33:27+00:00 2026-05-20T09:33:27+00:00

I have a .bat file like that: msg userA System will be restarted msg

  • 0

I have a .bat file like that:

msg userA System will be restarted
msg userB System will be restarted
msg userC System will be restarted
msg userD System will be restarted
msg userE System will be restarted
msg userF System will be restarted
msg userG System will be restarted

Can I define a variable for message part as like:

message = System will be restarted 
msg userA message
msg userB message
msg userC message
msg userD message
msg userE message
msg userF message

Also is it possible to define users as an array? As like:

users= [userA, userB, userC, userD, userE, userF]
message = System will be restarted 
msg users message

Thanks for your suggestions.

EDIT: I wrote that lines to a bat file:

set MESSAGE = System will be restarted
msg userA %MESSAGE%

When I click the bat file I got that screenshot: screenshot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:33:28+00:00Added an answer on May 20, 2026 at 9:33 am
    1. Yes; you can use environment variables:

      set MESSAGE=System will be restarted 
      msg userE %MESSAGE%
      
    2. Yes:

      set USERS=(userA userB userC userD userE userF)
      set MESSAGE=System will be restarted 
      
      for %%i in %USERS% do msg %%i %MESSAGE%
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bat file that I should use to delete a part of
I have a .bat and inside the .bat i would like to execute a
I have a simple bat script that copies files from an known directory to
I have to load a flat file that has different header and detail with
Could anyone help me out, I have a batch file find.bat which has a
On Windows XP system, I have test.bat C:\Path\to\php.exe -f C:\Path\to\test.php I also have test.php
I have a CHM help file that has a few clickable links to powerpoint
I have this .bat script which I use to maven package my application. Problem
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
I have a central hg repository with multiple subprojects in it. Somewhat like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.