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 7521253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:12:19+00:00 2026-05-30T02:12:19+00:00

Hi I want to create a batch which performs more than one operations. Like

  • 0

Hi I want to create a batch which performs more than one operations. Like it should display

1.Restart
2.Shutdown
3.Close all Windows
4.Log off
5.Switch User

Then “Enter your choice🙁User Choice)
Then it should perform the operation

Can you help in this?

  • 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-30T02:12:19+00:00Added an answer on May 30, 2026 at 2:12 am

    This should get you started. The CHOICE command is available in most versions of Windows but may require that you get the Windows NT 4 resource kit. The CHOICE command is available in Windows 7.

    @ECHO OFF
    CLS
    ECHO 1.Restart
    ECHO 2.Shutdown
    ECHO 3.Close all Windows
    ECHO 4.Log off
    ECHO 5.Switch User
    ECHO.
    
    CHOICE /C 12345 /M "Enter your choice:"
    
    :: Note - list ERRORLEVELS in decreasing order
    IF ERRORLEVEL 5 GOTO SwitchUser
    IF ERRORLEVEL 4 GOTO Logoff
    IF ERRORLEVEL 3 GOTO CloseAllWindows
    IF ERRORLEVEL 2 GOTO Shutdown
    IF ERRORLEVEL 1 GOTO Restart
    
    :Restart
    ECHO Restart (put your restart code here)
    GOTO End
    
    :Shutdown
    ECHO Shutdown (put your shutdown code here)
    GOTO End
    
    :CloseAllWindows
    ECHO Close All Windows (put your close all windows code here)
    GOTO End
    
    :Logoff
    ECHO Logoff (put your log off code here)
    GOTO End
    
    :SwitchUser
    ECHO Switch User (put your switch user code here)
    GOTO End
    
    :End
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a batch while which finds specific lines in a batch
I want to create a batch file which only continues if MASTERRESET.DLL consists of
I'm trying to create batch file which should have this commands: cd c:\Program files\NuSMV\2.5.2\bin\
I want to create a batch file which will parse through a given directory
I want to create a simple batch file that would perform some Visual Studio
I want to create a function that performs a function passed by parameter on
My bash fu is not what it should be. I want to create a
I need to create a backup script (both in batch and bash) which I
i want to create a batch file that executes command in it every 1
I want to create a workflow that will be persistent and which will consist

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.