# How to create a windows startup app

**URL:** <https://www.ruby-forum.com/t/how-to-create-a-windows-startup-app/115851>\
**Category:** Ruby\
**Created:** [September 29, 2007, 6:49am UTC](https://www.ruby-forum.com/t/how-to-create-a-windows-startup-app/115851 "2007-09-29T06:49:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssyed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ab992/32.png) [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Post date:** [September 29, 2007, 6:49am UTC](https://www.ruby-forum.com/t/how-to-create-a-windows-startup-app/115851/1 "2007-09-29T06:49:44Z")

</div>

I want my RUby app to automatically be called when windows boots up …  
what is the best way to do this? I am probably going to compile it to an  
exe… I would also like to know how to do this for Mac

---

<div class="post-metadata">

**Author:** ![ssyed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ab992/32.png) [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Post date:** [September 29, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/how-to-create-a-windows-startup-app/115851/2 "2007-09-29T16:33:32Z")

</div>

Sal Syed wrote:

> I want my RUby app to automatically be called when windows boots up …  
> what is the best way to do this?

Add a link to the program in the Start Up program group

or

add it to the registry (I forget the exact key, something along the  
lines of localmachine/software/microsoft/windows/current\_version/run).

In either case you’ll need to be sure the calling script will correctly  
load the Ruby interpreter. If your app is not getting called correctly  
at boot time, try wrapping it in a .bat file:

e.g.

REM myapp.bat  
c:\ruby\bin\ruby.exe c:\path\to\your\_app.rb

I am probably going to compile it to an

> exe… I would also like to know how to do this for Mac

Ruby code does not get compiled to exe. There are some apps that will  
wrap Ruby code into self-extracting, self-executing files; see  
rubyscript2exe, for example

–  
James B.

“Those who would give up Essential Liberty to purchase a little  
Temporary Safety, deserve neither Liberty nor Safety.”

- Benjamin Franklin, when asked about static typing  
(and a tip of the hat to raganwald)

---

<div class="post-metadata">

**Author:** ![ssyed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ab992/32.png) [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Post date:** [September 30, 2007, 1:08am UTC](https://www.ruby-forum.com/t/how-to-create-a-windows-startup-app/115851/3 "2007-09-30T01:08:43Z")

</div>

I. P. wrote:

> |James B.|
> 
> JB\> at boot time, try wrapping it in a .bat file:  
> JB\> REM myapp.bat  
> JB\> c:\ruby\bin\ruby.exe c:\path\to\your\_app.rb  
> And in this case you’d probably need Hstart utility  
> ([Hidden Start - Bypass UAC, Hide Console Windows, Run Apps in the Background - NTWind Software](http://www.ntwind.com/software/utilities/hstart.html))  
> which hides flickering console window.

If one is using Curt Hibb’s “one-click” installer version of Ruby, you  
can use the .rbw extension on the script and Ruby should execute with no  
visible cmd shell window.

The times I’ve had Ruby code execute at Windows launch I did not often  
use persistent processes; seeing the DOS box come up was a nice  
indicator that the code was actually running, and then seeing that it  
was not hanging.

–  
James B.

[www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[www.risingtidesoftware.com](http://www.risingtidesoftware.com) - Wicked Cool Coding  
[www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys

---

<div class="post-metadata">

**Author:** ![ssyed](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ab992/32.png) [@ssyed](https://www.ruby-forum.com/u/ssyed)\
**Post date:** [September 29, 2007, 9:28pm UTC](https://www.ruby-forum.com/t/how-to-create-a-windows-startup-app/115851/4 "2007-09-29T21:28:43Z")

</div>

|James B.|

JB\> at boot time, try wrapping it in a .bat file:  
JB\> REM myapp.bat  
JB\> c:\ruby\bin\ruby.exe c:\path\to\your\_app.rb  
And in this case you’d probably need Hstart utility  
([Hidden Start - Bypass UAC, Hide Console Windows, Run Apps in the Background - NTWind Software](http://www.ntwind.com/software/utilities/hstart.html))  
which hides flickering console window.
