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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:03:03+00:00 2026-05-27T05:03:03+00:00

I have the equivalent of the following in a batch script: net localgroup Cool

  • 0

I have the equivalent of the following in a batch script:

net localgroup "Cool Usergroup"

This may succeed, or it may fail for various reasons including:

System error 1376 has occurred.

The specified local group does not exist.

or

System error 5 has occurred.

Access is denied.

The problem is I need to look for these error codes, but the output is not coming through standard out or standard error. I’ve tried this:

net localgroup "Cool Usergroup" 2>&1 > %temp%\myGarbage.txt

But I still get the output splashed on the screen, not in the file.

To give a little more context, my original command is running in a for loop, and I’d like to get it working inside there, but there are additional problems with that.

for /f "tokens=*" %i in ( 'net localgroup "Cool Usergroup" 2>&1') do echo out: %i

gives me:

2>&1 was unexpected at this time.

So, how do I process these system errors in a batch script using a for loop? It doesn’t seem the output goes through standard error or standard out.

  • 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-27T05:03:03+00:00Added an answer on May 27, 2026 at 5:03 am

    Try this, it works on my system:

    net localgroup "Cool Usergroup" > %temp%\myGarbage.txt 2>&1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a class where I need accomplish the equivalent of the following
I am unfamiliar with Oracle and i need to have equivalent of my script
Does Java have an equivalent to .NET resource (.resx) files for localization? In .NET,
I have failed to find a Windows Runtime equivalent to the following WPF code
I have the following bash script (.sh) that's working just fine in Unix. I'd
I have decided it is impossible to do the following (equivalent) enum operations via
I have an xpath //tbody[1]/tr[1]/td[3]/b[1]/a[1] and would like a Jquery equivalent css expression following
I have about the equivalent to the following in my jsp. Neither here nor
What is the equivalent of following C# code to VB.net code. public void RaiseTotalTimeEvent(TotalTimeEventArgs
What is c# code equivalent of following XAML, where I have a RichTextBox and

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.