This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: equivalent to su or sudo?
- From: David Rothenberger <daveroth at acm dot org>
- To: cygwin at cygwin dot com
- Date: Fri, 17 Aug 2018 13:33:57 -0700
- Subject: Re: equivalent to su or sudo?
- References: <20180817100101.GB24845@rus.uni-stuttgart.de>
- Reply-to: cygwin at cygwin dot com
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