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: cygstart --directory switch is ignored when using --action=runas


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).


Regards,
Achim.


--
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]