Web lists-archives.com

Re: equivalent to su or sudo?

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.

cmd="$(cygpath -da "$1")"; shift
if [ $# -gt 0 ]; then
  powershell Start-Process "$cmd" -ArgumentList \""$@"\" -Verb RunAs -WindowStyle Hidden
  powershell Start-Process "$cmd" -Verb RunAs -WindowStyle Hidden

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