delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/29/09:56:18

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: How to run a cygwin command from the window scheduler
Date: Sat, 29 Jul 2006 09:55:58 -0400
Message-ID: <EF3AF6B4B4FB0D4486775A36A42812830105E9@sausatlexch02.corp.sa.net>
From: "Shaffer, Kenneth" <Kenneth DOT Shaffer AT sciatl DOT com>
To: <cygwin AT cygwin DOT com>
Reply-To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k6TDuDeg005630

> in a W2K3 command prompt (DOS) window
>
> 	C:\cywin\bin>     (which is the command prompt prompt)
>
> I type the command
>
> 	c:\cygwin\bin\bash -c "/local/adminscripts/test.sh"

Type "mount" instead from your DOS prompt while in the c:\cygwin\bin
directory.  If you see a mount point of "/" pointing to anywhere else
besides c:\cygwin, that could be part of your problem.

I recently had a mounting issue when upgrading from a very old cygwin,
b20 I think, and "umount -A" couldn't get rid of it, so I used regedit
to remove it.

The following is similar to what I use as a scheduled task:

    Run: C:\WINNT\system32\CMD.EXE /x /c start "Some title" /min
c:\cygwin\cygwin.bat cygwin_script arg1 arg2
    Start In: c:\cygwin     <-- must be a real disk drive and path
    Run as: domain\username

The cygwin.bat file:

    @echo off
    rem set HOME=c:\
    if "%DEF_PATH%"=="" set DEF_PATH=%PATH%
    set PATH=c:\cygwin\bin;%DEF_PATH%
    set myargs=%*
    if "%myargs%" == "" goto noarg
    rem echo %myargs%
    bash --rcfile %HOME%/.bashrc -i -c "%myargs%" 
    c:
    rem pause
    sleep 1
    goto exit
    :noarg

    rxvt -e /usr/bin/bash --login -i

    :exit
    exit

Ken Shaffer


     - - - - - Appended by Scientific Atlanta, a Cisco company - - - - -  This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019