delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/10/06/06:42:31

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=Xk7PnFMWOl3iZn9G009A1jzpKt4h5xpScSh2zDxDi5J7Iq1eYmOVs
2y7+kBoAR4XeWA4J1j+AF02wWwZEChP++TbVfYhmbCc6HsVC11QUVCgoq3AUyEAh
3VPkckWpR+vlHhV4DGQeggONI1lJT3bGRfJHPZ5IIZ4Bx5fedGUDD0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=lat1IBNphTunPLa3x7Q+E1Lp6Pc=; b=HGo4V0ywRaY03AqlpyzKdyKXMFSl
0IAuq0K5wlOXi+Y0bWCcssjKF6SyzRE38CaV0ic7gwR0MH4tSy+TMRVoO9qy6fuM
KYBrDIpXhunR/8IniwDdH+o5sxQIbz9uOHX06j3lKgp5wpMF+EDw7bAG7NVE7ZGK
GCcVxi445jgkmvk=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS,T_FSL_HELO_BARE_IP_2,T_RP_MATCHES_RCVD autolearn=no version=3.3.2
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Achim Gratz <Stromeko AT NexGo DOT DE>
Subject: Re: cygstart --directory switch is ignored when using --action=runas
Date: Mon, 6 Oct 2014 10:41:57 +0000 (UTC)
Lines: 20
Message-ID: <loom.20141006T120610-567@post.gmane.org>
References: <CAF3aVt-BBe90bAm9wQU1_JcOSeqEqGFAPJJ1-MsM5sKHqmGhMA AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019