How-To Start iTunes as a Windows service
Update 28/11/09
Download the application from here
http://www.johncleary.net/2009/11/download-jtunes-here/
I recently got around to getting an iPhone 3GS which hasn’t left my hand since. Being a gadget freak I cannot help but be in awe at the amount of technology packed into this device. This is not my first iPhone either. I got a first generation one sent over from America about two years ago as they were unavailable here at the time. I had the thing for less than two months before it got robbed on me. I only have myself to blame anyway because I spent most of Saturday nights running around bars and night clubs showing the thing to anybody that would care to give me five minutes of their time.
After playing around on the AppStore for a while I discovered a charming little free application named simply ‘Remote’. Once installed it lets you use your iPhone as a remote control for iTunes over your WiFi network. What’s more, you can also store multiple profiles on it which for someone like me who has access three PC’s and a laptop at home it’s a great feature. I could now take my music with me as I moved around the house controlling what music played from each computer all from my phone, but I had to be logged-on on each machine with iTunes running in order for this to work. This wouldn’t always be the case as there are other people who use the computers also or I simply may not be logged-on. It didn’t take long for me to start thinking how this setup could be improved on.
The one solution that came to mind was to somehow get iTunes to run as a Windows Service, so I started Visual Studio and Googled ‘C# Windows Service’. After a bit of reading I started on my App. I would need to develop a service that would run under my account and not the LocalSystem or LocalService accounts that a service will use by default. This was fine on my computer which is running Windows 7 Ultimate RC and other PC’s running Vista Ultimate as I can give my account the ‘Logon as Service’ privilege by simply opening the Local Security Policy editor, but the laptop runs Vista Home Premium which doesn’t have such easy access to the Local Security Policy. I finally found a simple little program on the net that allowed me to give the ‘Logon as Service’ privilege to users on non ‘Ultimate’ machines called NTRights.
I now can play music on any computer in my house with any user logged in or even if no one is logged-on and all this from my iPhone. The only problem is now when I try to start iTunes in the normal way it fails because it is running already as a background process so I have to stop and then restart the service while doing things like syncing my ipod. I am currently rewriting the app with a nice user (noob) friendly GUI instead of its current form being a bunch of console programs and batch scripts. I will release it here once it gets completed.
Popularity: 36% [?]


When is the release date?
Looking forward to this, I’ve been wanting to do it a while in our shared house but I’m too lazy.
Hi
This errors for me when installing the service, running Windows 7 Home. Any ideas please? Log below:
************** Exception Text **************
System.IO.IOException: The request is not supported.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Encrypt(String path)
at JTunesService.LoginDetails.SaveDetails(String Username, String ComputerName, String Password)
at JTunesService.Form1.installBtn_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
When is the release date?
Looking forward to this, I’ve been wanting to do it a while in our shared house but I’m too lazy.
+1
It is released. Just follow the link at the bottom of the article.
Still no suggestions for the above error I posted please?
James, I have updated the app so that you should not get that error any more. Try re-downloading the new version and give that a go.
I love this tool/application/service. Thanks John!
If you’re taking donations, where can I contribute?
$author Thanks for a wonderful post. Can not wait to come back and read more on your blog. Have a great day.