how to figure the admin's name and administrators workgroup name from command prompt?

  • Thread starter Thread starter ILiya
  • Start date Start date
I

ILiya

on windows with different languages admin's name and admin group names will differ. for example: Administrator (eng)=Àäìèíèñòðàòîð (rus). i'm writing bat file that will run on such systems. so obviousely i cannot hard code the names in the script.
so is there any chance i could get the names in script at run time?

thanks!
 
"ILiya" <iliya00@yandex.ru> wrote in message
news:%23SmpZohQIHA.1164@TK2MSFTNGP02.phx.gbl...
on windows with different languages admin's name and admin group names will
differ. for example: Administrator (eng)=Àäìèíèñòðàòîð (rus). i'm writing
bat file that will run on such systems. so obviousely i cannot hard code the
names in the script.
so is there any chance i could get the names in script at run time?

thanks!

You could use this batch file. It is a very crude solution - perhaps someone
else will propse something more elegant and more robust.
#@echo off
#goto Start
#-------------------------------------------------
#Display the names of the admin group & account
#Prerequisite: showpriv.exe (Windows Resource Kit)
#-------------------------------------------------
#:Start
#for /F "tokens=2 delims=\" %%a in ('showpriv sesecurityprivilege ^| find
"\"') do set AdminGroup=%%a
#for /F %%a in ('net localgroup %AdminGroup% ^| more +6') do (set
Administrator=%%a & goto Next)
#
#:Next
#echo Admin Group=%AdminGroup%, Administrator=%Administrator%
You must remove all # characters. Their only purpose is to mark
the beginning of each line.
 
Back
Top