This is the mail archive of the
mailing list for the Cygwin project.
Re: cygstart --directory switch is ignored when using --action=runas
- From: Achim Gratz <Stromeko at NexGo dot DE>
- To: cygwin at cygwin dot com
- Date: Mon, 6 Oct 2014 10:41:57 +0000 (UTC)
- Subject: Re: cygstart --directory switch is ignored when using --action=runas
- Authentication-results: sourceware.org; auth=none
- References: <CAF3aVt-BBe90bAm9wQU1_JcOSeqEqGFAPJJ1-MsM5sKHqmGhMA at mail dot gmail dot com>
Marcin Kurczewski <rr- <at> sakuya.pl> writes:
> >It seems the --directory switch is ineffective when used with --action=runas
> >when using cygstart. For example:
> >cygstart --action=runas --directory=`cygpath -wa $PWD` cmd.exe /k dir
> >The expected output is the contents of the working directory of the
> >cygwin shell the command was run from.
No, the expected output is exactly what you get unless you already are
running this command from an elevated prompt (which would be a pointless
exercise). An administrative CMD starts in a freshly created administrative
context separate from your user context and most settings in your user
context (including the current working directory) are not carried over. If
you want it to have a specific working directory you'll have to CD (mapped
drives only) or PUSHD (also accepts UNC paths).
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple