You could try having the batch file try to create a file in the root of c: (e.g. ECHO Test Text > C:\TEST.TXT) and the use IF EXIST C:\TEST.TXT to see if the file was created. Since restricted users have only read permissions to the root of c: the file will be missing whereas an Admin user will have the file.
I'm not sure about Power Users (I think have read only rights). Also if another security template has been applied (e.g. compatws) or the rights have been changed manually then this will not work.
what your asking might be able to be done, but not easily, like say in an IF statement...
you use the "net localgroup administrators >>member.txt"
on the command line which dumps the output to a text file..
then you could check the txt file to see if the users
(domain\user) name is in the file....if so hes an admin.
i know, not pretty. There maybe another option...you might be able to find out in the registry whether the current user has admin privliges..but i dont know. if you find out let us all know....
hope this helps
chris castelein
architectural designer
shive-hattery
cedar rapids iowa
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.