batch program to change user group

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

electroon

Thread Starter
Joined
Sep 17, 2008
Messages
1
Hi All,

Can any one please let me know how to change a user group in windows batch file i.e. equivalent of "newgrp" in unix.

I mean is there a command which will change users group before a exe is invoked. I mean to say suppose users default group is A and is also a member of group B. Whenever a utility is invoked from my batch file I want to change user group to B, how can I do this??

Please let me know any info.

Thanks in advance
 
Joined
Jul 28, 2008
Messages
1,899
You can use the "net localgroup" command, which will add the selected user to a group you specify, if you need anymore help just ask :D
 
Joined
Sep 27, 2008
Messages
116
Slightly confused about your question, are you wanted to remove a user from one group and put them in another group all together, or are you just simply trying to add them to another group as well? in any case both are easy and use some pretty basic commands...

if that's all then you can use these commands,

to add someone to a group

net localgroup GroupName UserName /add
to remove

net localgroup GroupName UserName /delete

Hope that's what your looking for...
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top