X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=yhgDaVm+Vxg+1ZuCOtRdXJogSE2t36Ir0HtLSTuU9Yf5y3xUo3LW5 wCk91J7rWUl9ZXFE38lnN4A7iIIcwyADkoMY3pKJGlvd/rGZGnwJEp3qWXuEkDtn irb53QO4hF6llglxfxya6qAaAKXpJMQ0XZp4guoWewnl7J2rqZpahw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; s=default; bh=I6RfLXVKvV61qx4KuSNrFcYobyE=; b=euXAvUcVNft7PLHBkmzePcxoypx2 bT04whkxLXwnN0RLFJnVvYsOcaVwRSjtx70kOvieFPwdnJw1mS3uP2FQIxT4glPZ zO+lJv/36tSk3KG+bJq7og24nkWvJuwqBKPdkDkHaRnIPHGC1Xl3DsE1B1wT3xB8 5Ts7dFThki2mexM= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Andrew Schulman Subject: Re: how to determine if a shell is running as Administrator? Date: Thu, 05 Feb 2015 09:39:09 -0500 Lines: 14 Message-ID: References: <1147992409 DOT 122575 DOT 1423130728220 DOT JavaMail DOT yahoo AT mail DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive: encrypt X-IsSubscribed: yes > > > 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. Andrew -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple