Re: scripting elevated privilege on Windows 7

2010-04-17 Thread Robert Pendell
On Fri, Apr 16, 2010 at 12:33 PM wrote: > Thank you Robert Pendell! I wrote this shell script. Any suggestions > for optimization? > > #!/bin/bash > if [ $# -eq 1 ] > then >        echo "Usage: elev program arg1 arg2 ..." >        exit 1 > fi > prog="$1" > shift > exec cygstart --action=runas `whic

Re: scripting elevated privilege on Windows 7

2010-04-16 Thread Eric Blake
On 04/16/2010 11:37 AM, Eric Blake wrote: > You are missing some quotes, and might as well use nicer quoting styles: ^^^ command substitution styles > > exec cygstart --action=runas "$(which "$prog") "$@" And I'm missing quotes, too.

Re: scripting elevated privilege on Windows 7

2010-04-16 Thread Eric Blake
On 04/16/2010 10:33 AM, davidarnst...@panix.com wrote: > Thank you Robert Pendell! I wrote this shell script. Any suggestions > for optimization? > > #!/bin/bash > if [ $# -eq 1 ] > then > echo "Usage: elev program arg1 arg2 ..." > exit 1 > fi > prog="$1" In assignment, there is n

Re: scripting elevated privilege on Windows 7

2010-04-16 Thread DavidArnstein
Thank you Robert Pendell! I wrote this shell script. Any suggestions for optimization? #!/bin/bash if [ $# -eq 1 ] then echo "Usage: elev program arg1 arg2 ..." exit 1 fi prog="$1" shift exec cygstart --action=runas `which "$prog"` "$@" -- Problem reports: http://cygwin.com

Re: scripting elevated privilege on Windows 7

2010-04-15 Thread Robert Pendell
On Thu, Apr 15, 2010 at 9:43 PM wrote: > > I am dealing with Windows UAC for the first time. From a script, I would > like to launch a process with elevated (administrative) privilege. I > can accept that Windows will pop up a modal dialog box confirming the > elevated privilege. > > Is there an ex

scripting elevated privilege on Windows 7

2010-04-15 Thread DavidArnstein
I am dealing with Windows UAC for the first time. From a script, I would like to launch a process with elevated (administrative) privilege. I can accept that Windows will pop up a modal dialog box confirming the elevated privilege. Is there an existing utility in Cygwin or elsewhere. An example o