From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89141 invoked by alias); 3 Aug 2017 11:43:05 -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 89108 invoked by uid 89); 3 Aug 2017 11:43:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=BAYES_40,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY,KAM_OTHER_BAD_TLD autolearn=no version=3.3.2 spammy=mintty, stealing, keyboard, Scheduler X-HELO: blaine.gmane.org Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Aug 2017 11:43:01 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ddEWh-0003TR-CM for cygwin@cygwin.com; Thu, 03 Aug 2017 13:42:51 +0200 To: cygwin@cygwin.com From: Oleksandr Gavenko Subject: Re: Hiding console when running Cygwin utility from Task Scheduler. Date: Thu, 03 Aug 2017 11:43:00 -0000 Message-ID: <861sosx4g9.fsf@gavenkoa.example.com> References: <86o9ryymx5.fsf@gavenkoa.example.com> <8660e5wnb6.fsf@gavenkoa.example.com> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (windows-nt) X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00040.txt.bz2 On 2017-08-02, Brian Inglis wrote: > I believe that conhost, mintty, ptys, cron, and Cygwin program startup open > handles for stdin, stdout, stderr to talk on, as those are assumed to be > available by most programs, rather than closing anything, which could terminate > program execution. > Small correction about `conhost`: https://blogs.technet.microsoft.com/askperf/2009/10/05/windows-7-windows-server-2008-r2-console-host/ https://blogs.msdn.microsoft.com/reiley/2012/09/13/windows-8-and-conhost-exe/ It is native Windows app. I believe that it is responsible to drawing native console and I want to hide it. > Cygwin run allows you to run a Windows GUI program with a hidden console window. > I think situation a bit different. run.exe is able to "hide" console of console app. Cygwin compiles each app as console as GUI app have no access to stdin/stdout and can't attach to any console, as state run(1): Windows programs are either GUI programs or console programs. When started console programs will either attach to an existing console or create a new one. GUI programs can never attach to an exiting console. There is no way to attach to an existing console but hide it if started as GUI program. >> My goal to avoid any splashes on screen and possible keyboard focus stealing >> from sudden task execution. > > I never see any windows or conhost processes running Cygwin Scheduled Tasks with > the previous suggestions and these settings: > >>> You may also have to set the (o) Run whether user is logged on or not >>> radio button, [X] Do not store password..., and [X] Run with highest >>> privileges check boxes. > > where the first may be most significant in this case; Thanks! That is. When I change from: [x] run only when user logged in to: [x] run whether user is logged on or not I don't see that temporary console window. I was going to check what happen with Cygwin app launched from nssm and see comment: 2017-04-26: Users of Windows 10 Creators Update should use prelease build 2.2.4-101 to avoid an issue with services failing to start. If for some reason you cannot use that build you can also set AppNoConsole=1 in the registry, noting that applications which expect a console window may behave unexpectedly. https://nssm.cc/download So Microsoft recently changed something in its console related API... -- http://defun.work/ -- 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