From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6607 invoked by alias); 11 Nov 2014 19:20:13 -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 6598 invoked by uid 89); 11 Nov 2014 19:20:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.ht-systems.ru Received: from smtp.ht-systems.ru (HELO smtp.ht-systems.ru) (78.110.50.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 11 Nov 2014 19:20:10 +0000 Received: from [91.78.178.160] (helo=darkdragon.lan) by smtp.ht-systems.ru with esmtpa (Exim 4.80.1) (envelope-from ) (Authenticated sender: postmaster@rootdir.org) id 1XoGyx-0005uk-16 ; Tue, 11 Nov 2014 22:20:03 +0300 Received: from [192.168.1.10] (HELO daemon2) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 11 Nov 2014 19:17:49 -0000 Date: Tue, 11 Nov 2014 19:20:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1785488620.20141111221749@yandex.ru> To: "Kertz, Denis (D)** CTR **" , cygwin@cygwin.com Subject: Re: Can't Run Excel From A Cron Job Under Windows 7 In-Reply-To: <883F2CBBC85A62419E181EB2F0ECF21F3E1169F8@US70UWXCHMBA04.zam.alcatel-lucent.com> References: <883F2CBBC85A62419E181EB2F0ECF21F3E1169F8@US70UWXCHMBA04.zam.alcatel-lucent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00245.txt.bz2 Greetings, Kertz, Denis (D)** CTR **! > I am trying to port a cygwin application that uses cron from a WinXP PC to > a Win7 Pro PC and I find some cron jobs won't run. Specifically, I need to > run an Excel program from a cron job and this doesn't work on my Win7 PC. > In order to run an Excel program from cygwin I have this run.excel bash > script with an embedded VB script that executes an Excel program: > excel=$1 > vbscript=/usr/tmp/$$.vbs > cat <<-! >$vbscript > Dim xlApp > Set xlApp = CreateObject("Excel.application") > Set xlWb = xlApp.workbooks.Open("$excel") > xlApp.Quit > Set xlWb = Nothing > Set xlApp = Nothing > ! > chmod 777 $vbscript > c:/Windows/System32/wscript.exe 'c:\cygwin64\usr\tmp\$$.vbs' > An excel program is run like this: > run.excel 'c:\Shared\Bin\Create_Daily_Scorecard.xls' > When I run an Excel program interactively with this run.excel script it > runs just fine but when I run it via a cron job Excel just hangs. Define "runs fine" please? What exactly that excel script is doing? > When Excel hangs I can look at the processes running on the PC using the > Windows Task Manager and I don't see the EXCEL.EXE process. But when I > check the option to show processes from all users I see the hung EXCEL.EXE > process, AND the user name displayed is my login. So I am running this under the > Upar2 login and Task Manager doesn't display EXCEL.EXE as a Upar2 process > but when I check 'Show processes from all users' it shows EXCEL.EXE running > under user name Upar2 - a contradiction. Task manager display processes started in your current session. Not processes started under your credentials. That's an important difference. > What I suspect is happening is Excel is attempting to do something that > requires Upar2 permission but it isn't really running as Upar2 so Excel > displays some error message and is waiting for the user to respond. But > Excel is running invisibly so this can't be seen. More like you expect to run Excel interactively from service. Not possible. Period. > I also suspect this Upar2 "confusion" isn't limited to running an Excel > program. I can run a cron job with regular UNIX commands (cut, sort, etc) > and see they are running with the ps command. But when I try to kill them > (kill -9) I get permission denied. If I want to kill a process running via > the cron I have to start cygwin with 'Run as administrator' and then I can > kill processes running under the cron. Of course. -- WBR, Andrey Repin (anrdaemon@yandex.ru) 11.11.2014, <22:14> Sorry for my terrible english... -- 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