Tech Support Guy banner
Status
Not open for further replies.
1 - 3 of 3 Posts

·
Registered
Joined
·
1 Posts
Discussion Starter · #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
 

·
Registered
Joined
·
1,899 Posts
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
 

·
Registered
Joined
·
116 Posts
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...
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top