With a batch script to set variable from For and Tokens and remove the first char:
for /f "tokens=1,2,3,4,5,6,7,8" %A in (
'net user %username% /domain ^|
find "Global Group memberships"'
)
do set groupname=%D:~1%
The groupname is like *Groupname and I need to delete the * char.
I check the variable using echo %groupname%
the output is *Groupname:~1%
How can I get the desired result?