From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16863 invoked by alias); 17 Aug 2018 20:36:13 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 16849 invoked by uid 89); 17 Aug 2018 20:36:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Administrator, rights, Hx-spam-relays-external:ESMTPA X-HELO: resqmta-ch2-05v.sys.comcast.net Received: from resqmta-ch2-05v.sys.comcast.net (HELO resqmta-ch2-05v.sys.comcast.net) (69.252.207.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Aug 2018 20:36:11 +0000 Received: from resomta-ch2-12v.sys.comcast.net ([69.252.207.108]) by resqmta-ch2-05v.sys.comcast.net with ESMTP id qkYDfm3rYRj83qlTdfXoEn; Fri, 17 Aug 2018 20:36:09 +0000 Received: from [10.253.4.88] ([74.217.72.250]) by resomta-ch2-12v.sys.comcast.net with ESMTPA id qlRZf89xpvhw1qlRafHsZU; Fri, 17 Aug 2018 20:34:07 +0000 Subject: Re: equivalent to su or sudo? To: cygwin@cygwin.com References: <20180817100101.GB24845@rus.uni-stuttgart.de> From: David Rothenberger Message-ID: <94a4da29-e383-11ec-f2cc-ced6afaf1ae2@acm.org> Date: Sat, 18 Aug 2018 03:50:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180817100101.GB24845@rus.uni-stuttgart.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin@cygwin.com X-SW-Source: 2018-08/txt/msg00243.txt.bz2 Ulli Horlacher wrote: > I need to run some scripts with full administrator rights (for chown, > chmod, setfacl). > Is there a cygwin equivalent to su or sudo? > I use the following shell script to start a command as Administrator. I mainly just use it to start mintty. #!/bin/bash cmd="$(cygpath -da "$1")"; shift if [ $# -gt 0 ]; then powershell Start-Process "$cmd" -ArgumentList \""$@"\" -Verb RunAs -WindowStyle Hidden else powershell Start-Process "$cmd" -Verb RunAs -WindowStyle Hidden fi -- 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