how to determine if a shell is running as Administrator?

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Feb 5 14:48:00 GMT 2015


On Feb  5 09:39, Andrew Schulman wrote:
> > 
> > 
> > Andrew Schulman wrote:
> > > What's a reliable and efficient way to determine programmatically if the shell> that's running has elevated privileges?
> > 
> > > Or if you prefer, how can I tell if the shell was started with "Run as
> > > administrator"?
> > 
> > If you search the  mailing list archive for "Change PS1 when running as administrator" there are several suggested ways.
> 
> Thanks.  Consensus there is to look for group ID 544, although as the other
> thread here shows, group 0 or 114 can also show it.

Preferredly you remove the "root" group from /etc/group or, even better,
you remove /etc/group ;)


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150205/c35a9c3f/attachment.sig>


More information about the Cygwin mailing list