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