From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29419 invoked by alias); 18 Nov 2014 01:36:29 -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 29400 invoked by uid 89); 18 Nov 2014 01:36:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp-fr.alcatel-lucent.com Received: from fr-hpgre-esg-01.alcatel-lucent.com (HELO smtp-fr.alcatel-lucent.com) (135.245.210.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 18 Nov 2014 01:36:25 +0000 Received: from us70tusmtp1.zam.alcatel-lucent.com (unknown [135.5.2.63]) by Websense Email Security Gateway with ESMTPS id ED2EAF359545B for ; Tue, 18 Nov 2014 01:36:20 +0000 (GMT) Received: from US70TWXCHHUB03.zam.alcatel-lucent.com (us70twxchhub03.zam.alcatel-lucent.com [135.5.2.35]) by us70tusmtp1.zam.alcatel-lucent.com (GMO) with ESMTP id sAI1aJvH010612 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Mon, 17 Nov 2014 20:36:20 -0500 Received: from US70UWXCHMBA04.zam.alcatel-lucent.com ([169.254.12.84]) by US70TWXCHHUB03.zam.alcatel-lucent.com ([135.5.2.35]) with mapi id 14.03.0195.001; Mon, 17 Nov 2014 20:36:19 -0500 From: "Kertz, Denis (D)** CTR **" To: "cygwin@cygwin.com" Subject: RE: Can't Run Excel From A Cron Job Under Windows 7 Date: Tue, 18 Nov 2014 01:36:00 -0000 Message-ID: <883F2CBBC85A62419E181EB2F0ECF21F3E11CABC@US70UWXCHMBA04.zam.alcatel-lucent.com> References: <883F2CBBC85A62419E181EB2F0ECF21F3E1169F8@US70UWXCHMBA04.zam.alcatel-lucent.com> <1785488620.20141111221749@yandex.ru> <883F2CBBC85A62419E181EB2F0ECF21F3E118128@US70UWXCHMBA04.zam.alcatel-lucent.com> <1991456701.20141112231225@yandex.ru> <883F2CBBC85A62419E181EB2F0ECF21F3E118381@US70UWXCHMBA04.zam.alcatel-lucent.com> <1375040469.20141114012521@yandex.ru> In-Reply-To: <1375040469.20141114012521@yandex.ru> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg00435.txt.bz2 >>> Try starting cron in terminal session and see if anything comes up. > > Stop (don't kill! Everyone, who use -KILL, must be -KILL'ed) the cron ser= vice, > then start cron in terminal, using `runas /user:... ...'. So it would run > under proper user, and see if anything come up, when it execute your excel > job. I was unable to find how to use runas from a terminal. I can simply type r= unas and it does nothing and I can't find --help or /help. I did find a su= ggestion to use cygstart so I tried this: $ cygstart --action=3Drunas '/bin/cygrunsrv --start cron' Unable to start 'C:\cygwin64\bin\cygrunsrv --start cron': The specified fil= e was not found. So that didn't work. I did try starting the cron service (cygrunsrv) from = a terminal session run as administrator and I tried starting the cron servi= ce from the Windows services.msc. Nothing has worked for running an Excel = program with my run.excel script. I created a "null" .xls file that does nothing when run by Excel. I can ru= n my script (run.excel c:/Shared/Bin/null.xls) from a bash prompt and it d= oes nothing (as expected) and terminates but when I run this same script fr= om a cron job Excel starts but never terminates. Running a ps command I se= e this: $ ps PID PPID PGID WINPID TTY UID STIME COMMAND 5188 1184 5188 4928 ? 1000 19:00:01 /usr/bin/sh 6040 5820 5188 4428 ? 1000 19:00:02 /cygdrive/c/Win= dows/System32/wscript <-- runs vb script that starts Excel 1808 4464 1808 5704 ? 1000 18:24:25 /usr/sbin/cron 5184 5540 5184 6048 pty1 1000 21:13:03 /usr/bin/bash 3368 5184 3368 5560 pty1 1000 19:00:25 /usr/bin/ps 5820 5188 5188 5820 ? 1000 19:00:02 /usr/bin/sh 4464 1 4464 4464 ? 1000 18:24:25 /usr/bin/cygrun= srv 1184 1808 1808 1184 ? 1000 19:00:01 /usr/sbin/cron 5540 1 5540 5540 ? 1000 21:13:03 /usr/bin/mintty $ And I see the Excel.Exe *32 in the process list of Task Manager so I know E= xcel was started. Note the above ps command shows the wscript command running which is the co= mmand that executes the vb script that runs Excel. Also note that all of t= hese processes including the wscript command show the 1000 UID which is the= Upar2 login UID in the /etc/passwd file. I also look in the services.msc window and the cron service properties show= s Login As .\Upar2. I see the same on the WinXP PC where I can run Excel s= uccessfully from a cron job. Denis -- 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