This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

#!/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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]