X-Recipient: archive-cygwin@delorie.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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@cygwin.com
From: Achim Gratz <Stromeko@NexGo.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@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
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

