delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/14/10:07:50

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <31144428.post@talk.nabble.com>
Date: Mon, 14 Mar 2011 07:07:35 -0700 (PDT)
From: PeterSmith <petervdkerk AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Autostart Cygwin on Windows boot and run a cygwin command
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

Sometimes my Windows server reboots at night to install new updates. Then the
next day I find out that my cygwin instance has been stopped.

What I want is on Windows start, also run Cygwin AND run a specific command.

so, step 1: Right now I have a cygwin.bat to start cygwin:

@echo off
C:
chdir C:\cygwin\bin
bash --login -i

step 2 is to enter the command in the command windows that appears after
running cygwin.bat:

cd /cygdrive/e/solr/apache-solr-4.0-2010-10-12_08-05-48/example/;java
-Dsolr.solr.home="./example-DIH/solr/" -jar start.jar

But this command is what I want to have called automatically when i run
cygwin.bat

How can I combine step 1 and step 2 into a single bat file which I can run
on Windows start?

I tried this code:
@echo off
C:
chdir C:\cygwin\bin
bash -c cd
/cygdrive/e/solr/apache-solr-4.0-2010-10-12_08-05-48/example/;java
-Dsolr.solr.home="./example-DIH/solr/" -jar start.jar

But that doesnt work...

-- 
View this message in context: http://old.nabble.com/Autostart-Cygwin-on-Windows-boot-and-run-a-cygwin-command-tp31144428p31144428.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
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

- Raw text -


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