You are here:
OakRoadSystems → Home → Articles → Technical → Curb Services (Win 7)

Curb Unneeded Services in Windows 7

Revised 28 May 2012

Copyright © 2011–2017 by Stan Brown, Oak Road Systems

Summary: Application programs have the unfortunate habit of installing “services” that launch when Windows launches and always run in background, even when not needed. This page explains how to set up your system to make those services run only when actually needed. Examples given are iTunes and Acronis TrueImage.

The process is a nutshell: find and stop the relevant service(s), build a batch file to manage the services and the application in one go, and create an administrator shortcut in your start menu to that batch file. and set As always, the devil is in the details, but I’ll walk you through step by step.

Contents:

See also: Other Windows tips (all of them shorter!) are at Windows 7 Tips and Tweaks.

Why Bother?

Why not just let the applications’ services run continuously in background? Well, any program has to add some time to your bootup and take some system resources. Only you can judge if it’s a big enough deal to be worth fighting back. My own preference is to have as little running as possible, because then I’m more likely to spot something running that shouldn’t be. Plus, I just like to keep things lean and clean.

Some history: This idea was suggested to me by an article on Lifehacker.com called Create Service-Stopping Batch Files to Optimize Your PC for Specific Tasks. But that’ article did just one piece of the job. Stopping services after the application runs wasn’t enough. This is a computer, and I want to click one thing to run my application. That means one automated process of starting the services, launching the application, and then stopping the services after the application finishes.

“Automated process” suggests a script or a batch file. As it happens, I know the command line and batch files and I don’t know Windows scripting, so the choice was easy for me. I knew the nucleus would be a start /wait command to launch the application. But things turned out to be rather more complex than I expected. I have to say a big thank-you to the folks in the newsgroup alt.windows7.general, who generously helped me get past several obstacles including some errors of my own.

The two applications that most concerned me, iTunes and Acronis TrueImage, turned out to be rather different in the way they handle services. Between the two of them, I think you’ll see all you need to tackle your favorite application. If you find some wrinkle that I’ve missed, please write and let me know.

Example 1: Acronis TrueImage

Applies to: Acronis TrueImage Home 10 and 11. I suspect other Acronis versions have the same issues, but you should check for yourself if you’re following these instructions to tame Acronis services.

Services: TrueImage installs two services (that I know of) that start with Windows and run constantly in background:

Like many people, I use an external hard drive for backups. And I connect it only when I’m actually doing a backup.Why “Nonstop Backup Service” must be running when I don’t do nonstop backups, and why “Acronis Scheduler2 Service” must be running when I don’t do scheduled backups (and when Windows has a perfectly good scheduler), Acronis was unable to tell me. Why these services must be running when making an on-demand backup, Acronis was also unable to tell me, but experiment shows that they have to be.

The plan: Set these two services to “Manual” so that they don’t start with Windows. Then, in a batch file called AcronisBackup.bat, start them before running Acronis and stop them after running Acronis.

Set Services to Manual

You set service properties in the Services.msc program, which will prompt you for administrative privilege when you run it. Click the Windows start button, type services.msc and press the Enter key.

  1. properties dialog for Acronis Nonstop Backup Service Find “Acronis Nonstop Backup Service”, right-click it and select Properties. Select the General tab of the dialog.
  2. In the lower part of the dialog, if the service is not already stopped, click the Stop button.
  3. In the middle of the dialog, change Startup type to “Manual” and then click Apply.
  4. Your dialog should now look like the one at the right. Make note of the Service name at the top (afcdpsrv), because you’ll need it for the batch file. Then close the dialog box.

Repeat those steps for “Acronis Scheduler2 Service”. Its service name is AcrSch2Svc. Then close the main Services window.

Create the Batch File

Decide where you’ll put your batch file. I don’t recommend anywhere in C:\Program Files or C:\Program Files (x86), because Windows 7 really likes to manage those by itself. I personally use C:\Utilities, but you could use any of your folders.

  1. Press Winkey+E or double-click Computer to open Windows Explorer. (Windows Explorer is the application that, among other things, explores files and folders on your computer. It’s not the same as Internet Explorer.)
  2. Navigate to the folder where you intend to put your batch file.
  3. Right-click in an empty area of the display and select New » Text document. Don’t worry about naming it yet.
  4. Double-click the new file and an editor window will come up. Paste in these lines:
    setlocal disableextensions
    @echo.
    @echo Have you emptied the Recycle Bin?
    @echo.
    @pause
    net start afcdpsrv
    net start AcrSch2Svc
    start "Acronis" /wait "C:\Program Files (x86)\Acronis\TrueImageHome\TrueImage.exe"
    net stop afcdpsrv
    net stop AcrSch2Svc
    endlocal
    

    Check your install path for Acronis, and make the appropriate change if it’s different from mine.

    Curious about the batch commands? See Batch File Arcana, below.

  5. Save the file and close the editor.
  6. Right-click the file and select Rename. The new name can be anything ending in “.bat”—I chose “AcronisBackup.bat”.

    Keep this window open, because it’s needed in the next section.

Create a Start Menu Shortcut

Finally, create a shortcut to this batch file and place the shortcut in the start menu. From then on, use this shortcut instead of the one that Acronis created.

  1. Click the Windows start button, then right-click All Programs » Open. A window opens into your start menu. Double-click “Programs” and then navigate to or create the folder where you want to put the shortcut. I’ve got a folder called “0 Personal Programs” so that it sorts first, but of course you could have any folder. I don’t recommend putting the shortcut in the Acronis folder because you may lose it when you update or reinstall Acronis.
  2. Right-click your batch file and drag it to the start menu folder you selected. When you release the mouse button, you get an options menu; select Create shortcuts here.
  3. Rename the batch file to what you want to see in the start menu. (I chose “Acronis Backup”.)
  4. Right-click the shortcut and choose Properties » Shortcut » Advanced. Check or tick Run as Administrator and click OK.
  5. In the Properties dialog, you can assign a shortcut key if you wish. This is less of a big deal than it was in earlier Windows, because now you also have the option to pin it to the start menu, but I kind of like shortcut keys for a program I should use every day, so I assigned Ctrl+Shift+Alt+B for backup.
  6. Click OK to close the dialog box.

Finished!

Because this article helps you,
please click to donate!
Because this article helps you,
please donate at
OakRoadSystems.com/donate.

And that’s it at last. Now I use my new shortcut instead of the Acronis-made shortcut. I get the administrator prompt and answer it, the services start almost instantly, and I’m in Acronis TrueImage. The batch file is still there, waiting for me to finish with Acronis, and when I do it stops the services and exits. No extra work for me, and I have two fewer services running all the time in background.

Example 2: iTunes

Applies to: iTunes 9 and 10. Ed Bott has written about the iTunes 10 installer, and iTunes 9 seemed pretty similar, with one exception that I’ll get to.

Services: iTunes installs three services (that I know of) that start with Windows and run constantly in background:

Apple Mobile Device isn’t needed for my particular iPod, just for iPad, iPod Touch, and iPhone. Bonjour is for file sharing across networks and for Apple TV, which I don’t have. iPod Service is needed to sync my iPod, but not when I just want to run iTunes to listen to music or manage media files.

Your equipment and usage may be different from mine, so you might need to disable fewer or different services. See Bott’s article for guidance based on your needs.

Apple Software Update is a question mark. Bott’s article makes it sound pretty obtrusive, but in iTunes 9 I didn’t see it as a background process in Task Manager nor as a service in Services.msc, even though Control Panel » Programs and Features shows it as installed. Either this is a difference between iTunes 9 and 10, or I disabled it long ago and forgot about it. When I upgraded to iTunes 10, I followed his advice and didn’t even install it.

The plan: Disable all three services. Then run iTunes in one of two ways: when I just want to access media files I’ll run it using Apple’s shortcut, but when I want to sync with iPod I’ll use my new shortcut.

Why disable the services, rather than just stop them as I did with Acronis? Because if the services are merely stopped, iTunes starts them again. (I’m not certain about Bonjour and Apple Mobile, but I have tested iPod Service and iTunes definitely restarts it.) So it’s necessary to disable them.

Disable Services

You set service properties in the Services.msc program, which will prompt you for administrative privilege when you run it. Click the Windows start button, type services.msc and press the Enter key.

  1. Find “iPod Service”. Right-click it and select Properties. Select the General tab of the dialog.
  2. In the lower part of the dialog, if the service is not already stopped, click the Stop button.
  3. In the middle of the dialog, change Startup type to “Disabled”, and then click OK. (Assuming you use iTunes to sync to an iPod, you actually need this service, but Create the Batch File, below, explains how to run iPod Service only when it’s actually needed.)
  4. Look for “Apple Mobile Device”. If you don’t have an iPod Touch, iPhone, or iPad, this shouldn’t even be here. If it is, you can uninstall it in Control Panel » Programs and Features.
  5. Look for “Bonjour Service”. If you don’t have Apple TV and don’t want to share iTunes libraries across a home network, this shouldn’t be here. If it is, you can uninstall Bonjour in Control Panel » Programs and Features.
  6. Close the Services dialog.

Create the Batch File

Decide where you’ll put your batch file. I don’t recommend anywhere in C:\Program Files or C:\Program Files (x86), because Windows 7 really likes to manage those by itself. I personally use C:\Utilities, but you could use any of your folders.

  1. Press Winkey+E or double-click Computer to open Windows Explorer.
  2. Navigate to the folder where you intend to put your batch file.
  3. Right-click in an empty area of the display and select New » Text document. Don’t worry about naming it yet.
  4. Double-click the new file and an editor window will come up. Paste in these lines:
    setlocal disableextensions
    sc config "iPod Service" start= demand
    net start "iPod Service"
    start "iTunes" /wait "C:\Program Files (x86)\iTunes\iTunes.exe"
    net stop "iPod Service"
    sc config "iPod Service" start= disabled
    endlocal
    

    Check your install path for iTunes, and make the appropriate change if it’s different from mine.

    Curious about the batch commands? See Batch File Arcana, below.

  5. Save the file and close the editor.
  6. Right-click the file and select Rename. The new name can be anything ending in “.bat”—I chose “iTunesSync.bat”.

    Keep this window open, because it’s needed in the next section.

Create a Start Menu Shortcut

Finally, create a shortcut to this batch file and place the shortcut in the start menu.

  1. Click the Windows start button, then right-click All Programs » Open. A window opens into your start menu. Double-click “Programs” and then navigate to or create the folder where you want to put the shortcut. I’ve got a folder called “0 Personal Programs” so that it sorts first, but of course you could have any folder. I don’t recommend putting the shortcut in the iTunes folder because you may lose it when you update or reinstall iTunes.
  2. Right-click your batch file and drag it to the start menu folder you selected. When you release the mouse button, you get an options menu; select Create shortcuts here.
  3. Rename the batch file to what you want to see in the start menu. (I chose “iTunes with sync”.)
  4. Right-click the shortcut and choose Properties » Shortcut » Advanced. Check or tick Run as Administrator and click OK.
  5. In the Properties dialog, you can assign a shortcut key if you wish. This is less of a big deal than it was in earlier Windows, because now you also have the option to pin it to the start menu. Since I don’t sync my iPod even once a week, I don’t need any kind of acceleration with this one.
  6. Click OK to close the dialog box.

Finished!

Finally! Now I have two paths for running iTunes:

Error message from Bonjour: The first time you run iTunes after making these changes, it will complain that Bonjour isn’t running and tell you about all the devices you can’t use without it. You can safely dismiss that message if you don’t have any of those devices.

Appendix: Batch File Arcana

As I said at the outset, I knew that the nucleus would be a start /wait command, but things quickly got more complicated. Here’s what I learned on my own and with the help of the good folks in the alt.windows7.general newsgroup.

Making /wait Work

The /wait option is needed on program launch to pause the batch file. The batch file must not go on to the next line (stopping the service) until the application has finished. But the help text from start /? says that when command extensions are enabled, /wait is ignored for 32-bit programs—which Acronis is. So I needed to disable “command extensions” while the batch file is running.

Windows help comes up with a list of irrelevant hits when I search for “command extensions”. (There’s a surprise ... not!) I did find the information I needed in the command prompt via cmd /? and setlocal /?.

setlocal lets me disable disable extensions just within this batch file, which is exactly what I want. An endlocal at the end would be implied, but I like to spell things out.

Starting and Stopping Services

The net start and net stop commands start and stop services. One interesting wrinkle is that each service has two names, its service name and its display name. Sometimes, as with iTunes, they’re the same; but they can be different, as they are with Acronis. You need the service name from the Properties dialog, not the display name. And if the service name contains any spaces, you must enclose it in quotes on the command line.

I’ve seen Web advice to start and stop services with the sc command, but that didn’t work for me.

Enabling and Disabling Services

Because iTunes is so ill behaved, it’s not enough just to stop its services; you actually have to disable them. If a service is disabled, iTunes can’t start it—but neither can my batch file. So in the iTunes batch file I have to enable the service before trying to start it, then re-disable it after stopping it. The sc config command will do that, but notice that there are required spaces after start= and stop=.

Launching the Program

There’s an error in the help text for start: it marks the window title as optional, but in fact it seems to be required.

The other issue is to know which program to launch. Start by right-clicking the program’s own shortcut in the start menu and selecting Properties » Shortcut » Target.

If the application has suppressed the path in that box, as iTunes does, then you’ll have to go exploring for it, probably in C:\Program Files or C:\Program Files (x86).

But even if there’s a path there, it might not be the right executable. For example, the Acronis TrueImage Home shortcut launches something called TrueImageLauncher.exe, which sounds as though it should be right. But I discovered that the /wait option didn’t seem to be working, even after I disabled command extensions. It was a newsgroup suggestion that revealed the answer: TrueImageLauncher is just a launcher: all it does is start up the real program and then exit. The batch file saw that TrueImageLauncher had finished, so it went on to stop the service. The cure was to find the actual program, TrueImage.exe, and put that in the batch file.

Either way, be prepared to do some exploring and testing to find the right application file to launch within the batch file.

Elevating Privilege

The net start command requires elevated privilege, and when run in a batch file it must inherit that privilege from the batch file. This is why each shortcut has to be set to run as administrator.

What’s New

Because this article helps you,
please click to donate!
Because this article helps you,
please donate at
OakRoadSystems.com/donate.

Updates and new info: http://oakroadsystems.com/tech/

Site Map | Home Page | Contact