Starting Tracks in a Hidden Window
First, open Notepad and paste the following into it:
Const HIDDEN_WINDOW = 12
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("ruby g:\tracks\script\server.rbw --environment=production", null, objConfig, intProcessID)
You need to change the portion that reads “ruby g:\tracks\script\server.rbw –environment=production” to read correct for where you installed Tracks.
Then, save the file and call it “tracks.vbs”.
Now, move the file to wherever you’d like to keep it (I keep it in my g:\tracks directory).
Now, create a new text document in notepad, and put the following into it:
cscript g:\tracks\tracks.vbs
Again, change the g:\tracks\tracks.vbs to reflect where you placed the tracks.vbs file.
Save the file as “tracks.bat”.
Now, you can double-click on “tracks.bat” and it will load Tracks into a hidden window. Give it about a minute or so, and you should be able to login at http://localhost:3000
To start tracks when you log in to Windows, you merely need to create a shortcut to the tracks.bat file in your startup folder on the start menu (or, you can do like me and place the actual tracks.bat in your startup folder).
To close/stop Tracks:
For Windows XP: open your task manager (CTRL-ALT-DEL), go to the “Processes” tab, find the line that says “Ruby”, click it once to highlight it, and click the “End Process” button. The system may throw you a warning that you can safely ignore.
For Windows NT/2000/2003: Hit CTRL-ALT-DEL, click the Task Manager (or Process Manager) button, find the process list and locate “Ruby.” Click it once to highlight it, click “End Process”.
For Windows 98/ME: Hit CTRL-ALT-DEL, Find “Ruby,” click to highlight, click “End Task”. If you can’t find Ruby on your Windows 98 task list, then upgrade to Windows XP. heh.
Enjoy Tracks when you start.
Technorati Tags: Tracks, code hacking, WindowsHelp spread the love and Share This









