public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygstart --directory switch is ignored when using --action=runas
@ 2014-10-06  9:03 Marcin Kurczewski
  2014-10-06  9:17 ` Marco Atzeri
  2014-10-06 10:42 ` Achim Gratz
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Kurczewski @ 2014-10-06  9:03 UTC (permalink / raw)
  To: cygwin

I just ran into an issue that was already explained by someone else here:
http://superuser.com/questions/720846/cygstart-directory-switch-is-ignored-when-using-action-runas

Below I paste contents of above report, from ZeroKnight:

>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. Instead, it outputs the contents of
>C:\Windows\system32, the default starting path for an administrative command
>prompt, completely ignoring the --directory switch. In contrast, omitting the
>--action=runas switch gives the expected output, but obviously not with
>elevated permissions.

Confirmed the bug to still exist on my version of Cygwin, which is:

CYGWIN_NT-6.2-WOW64 work 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cygstart --directory switch is ignored when using --action=runas
  2014-10-06  9:03 cygstart --directory switch is ignored when using --action=runas Marcin Kurczewski
@ 2014-10-06  9:17 ` Marco Atzeri
  2014-10-06 10:42 ` Achim Gratz
  1 sibling, 0 replies; 3+ messages in thread
From: Marco Atzeri @ 2014-10-06  9:17 UTC (permalink / raw)
  To: cygwin

On 06/10/2014 11:03, Marcin Kurczewski wrote:
> I just ran into an issue that was already explained by someone else here:
> http://superuser.com/questions/720846/cygstart-directory-switch-is-ignored-when-using-action-runas
>
> Below I paste contents of above report, from ZeroKnight:
>
>> 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. Instead, it outputs the contents of
>> C:\Windows\system32, the default starting path for an administrative command
>> prompt, completely ignoring the --directory switch. In contrast, omitting the
>> --action=runas switch gives the expected output, but obviously not with
>> elevated permissions.
>
> Confirmed the bug to still exist on my version of Cygwin, which is:
>
> CYGWIN_NT-6.2-WOW64 work 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin
>

works fine on my system

$ uname -vrs
CYGWIN_NT-6.1-WOW64 1.7.32(0.274/5/3) 2014-08-13 23:03

What about
1) updating your system
2) following https://cygwin.com/problems.html guidelines ?

Regards
Marco

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cygstart --directory switch is ignored when using --action=runas
  2014-10-06  9:03 cygstart --directory switch is ignored when using --action=runas Marcin Kurczewski
  2014-10-06  9:17 ` Marco Atzeri
@ 2014-10-06 10:42 ` Achim Gratz
  1 sibling, 0 replies; 3+ messages in thread
From: Achim Gratz @ 2014-10-06 10:42 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-06 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06  9:03 cygstart --directory switch is ignored when using --action=runas Marcin Kurczewski
2014-10-06  9:17 ` Marco Atzeri
2014-10-06 10:42 ` Achim Gratz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).