delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/14/14:40:42

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4D7E6112.1030405@bopp.net>
Date: Mon, 14 Mar 2011 13:40:18 -0500
From: Jeremy Bopp <jeremy AT bopp DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Autostart Cygwin on Windows boot and run a cygwin command
References: <31144428 DOT post AT talk DOT nabble DOT com> <4D7E5A1D DOT 5030702 AT bopp DOT net> <31147099 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <31147099.post@talk.nabble.com>
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

On 3/14/2011 13:25, PeterSmith wrote:

FYI, this list prefers bottom posting rather than top posting.
Reformatting... :-)

> Jeremy Bopp-3 wrote:
>> 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
>>
>> If you still have problems, please provide more details. :-)
>
> First of: sorry for not providing all info.
>
> I DO want to run this command as soon as my machine boots. My server
> sometimes reboots at night after an update. So when Windows starts, in the
> Startup Folder I will place a shortcut to the .bat file.

What Startup Folder are you talking about exactly?  I'm probably just
not aware of such a folder whose contents are executed by the system
upon boot up, but if you're talking about the folder for your user
account, that will only be run when you log in.  If your machine
automatically logs you in on boot up, you'll be fine in that case;
otherwise, you'll need to hook this up a bit differently.

You may want to look into the Registry:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

I'm not sure if you can directly run a batch file there or if you'll
have to run cmd with the batch file as an argument.  Assuming this works
for you, the only problem then will likely be that this will run as the
Local System account rather than your user, which may or may not matter
to you.

> I the bat file I now have:
> @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

I forgot to include the final quote in my first reply.  Try again with a
quote at the end of that last line.

-Jeremy

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