From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17510 invoked by alias); 6 Oct 2014 10:42:17 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 17500 invoked by uid 89); 6 Oct 2014 10:42:16 -0000 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 Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 06 Oct 2014 10:42:15 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xb5k2-0000K6-Rg for cygwin@cygwin.com; Mon, 06 Oct 2014 12:42:10 +0200 Received: from 217.10.52.10 ([217.10.52.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2014 12:42:10 +0200 Received: from Stromeko by 217.10.52.10 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2014 12:42:10 +0200 To: cygwin@cygwin.com From: Achim Gratz Subject: Re: cygstart --directory switch is ignored when using --action=runas Date: Mon, 06 Oct 2014 10:42:00 -0000 Message-ID: References: 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 X-SW-Source: 2014-10/txt/msg00059.txt.bz2 Marcin Kurczewski 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