delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/14/15:21:24

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: <31147631.post@talk.nabble.com>
Date: Mon, 14 Mar 2011 12:21:08 -0700 (PDT)
From: PeterSmith <petervdkerk AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Autostart Cygwin on Windows boot and run a cygwin command
In-Reply-To: <4D7E6112.1030405@bopp.net>
MIME-Version: 1.0
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> <4D7E6112 DOT 1030405 AT bopp DOT net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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



Jeremy Bopp-3 wrote:
> 
> 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
> 
> 
> 

Ok, so for now lets focus on the contents of the .bat file. I'll have a look
at the startup of the bat later :)

I now have this:
@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 still gives me the exact same error:
C:\>start_cygwin.bat
bash: line 0: cd:
/cygdrive/e/solr/apache-solr-4.0-2010-10-12_08-05-48/example/: No such file
or dir
ectory
Unable to access jarfile start.jar
C:\cygwin\bin>


However, when I have this in my .bat file:
@echo off
C:
chdir C:\cygwin\bin
bash --login -i
rem 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 DO get the Cygwin command prompt. What am I missing here?


-- 
View this message in context: http://old.nabble.com/Autostart-Cygwin-on-Windows-boot-and-run-a-cygwin-command-tp31144428p31147631.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