From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15672 invoked by alias); 10 Jul 2012 18:59:17 -0000 Received: (qmail 15663 invoked by uid 22791); 10 Jul 2012 18:59:16 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-yw0-f43.google.com (HELO mail-yw0-f43.google.com) (209.85.213.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 18:59:03 +0000 Received: by yhl10 with SMTP id 10so369451yhl.2 for ; Tue, 10 Jul 2012 11:59:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.76.170 with SMTP id l10mr75703378paw.57.1341946741834; Tue, 10 Jul 2012 11:59:01 -0700 (PDT) Received: by 10.66.82.6 with HTTP; Tue, 10 Jul 2012 11:59:01 -0700 (PDT) In-Reply-To: References: <20120709154456.GA6696@ednor.casa.cgf.cx> <1BBEF94B6B46E54980290D150A6F2EDD20C950F5@SN2PRD0610MB396.namprd06.prod.outlook.com> Date: Tue, 10 Jul 2012 18:59:00 -0000 Message-ID: Subject: Re: Inconsistence on file operation when the name already exists with exe extension From: Earnie Boyd To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes 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 X-SW-Source: 2012-07/txt/msg00144.txt.bz2 On Tue, Jul 10, 2012 at 12:54 PM, Aaron Schneider wrote: > I don't see how you can run a PE executable from windows shell (cmd.exe) > directly without the exe extension. I've just tried it in several ways and > always prompts me the "Open with..." dialog instead of directly running it > because treats it as data. > Ok, it did work but for some reason with XP SP2 a file with out an extension isn't being executed. If I copy for example c:\windows\system32\ping.exe to myping.ping and execute it searching for google.com then it works as expected. If I remove .ping the myping doesn't execute, so much for consistency. > When you say that Windows XP and above can run an executable without > extension, you are talking about running it from windows shell. But I was > referring in the end to the cygwin terminal (C:\cygwin\bin\mintty.exe -) > that I believe can run exe without extension even in older versions of > windows, because it's bash that launches it as you said before. Mintty is a terminal. Bash, Csh, Ksh, Ash, etc all would run in the Mintty terminal as the shell, you still don't understand the difference. The terminal is the interface providing fonts, keyboard and mouse interactions responding to the window events. Bash, Csh, Ksh, etc are shells that act on the commands given it and each has its own syntax for those commands. > > That's being said because I expect users to run commands from the cygwin > terminal. The exe extension is needed if you want to run the linux commands > directly from the windows shell directly (c:\cygwin\bin\ and other bash > PATHs should be exported to the windows PATH to run them directly from > windows shell, but you will mix things up) The .exe isn't needed on the command line. It is found by the Cygwin runtime without it and the full file path given to CreateProcess when it executes it. -- Earnie -- https://sites.google.com/site/earnieboyd -- 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