Server Solver

What's That Service For?

Spyware or necessary? How to find out what the services running on a Windows XP machine are really used for.

Zubair: I've noticed a service called C-DillaSrv on my Windows XP computer. I didn’t install this service and was wondering if it’s spyware. How can I remove this service if it’s not needed? I looked in the Services console and discovered that it has no dependencies. Is there a simple way to find out what files/DLLs are used by a particular service?
— Maria

Tech Help—Just An
E-Mail Away

Got a Windows, Exchange or virtualization question or need troubleshooting help? Or maybe you want a better explanation than provided in the manuals? Describe your dilemma in an e-mail to the MCPmag.com editors at mailto:editor@mcpmag.com; the best questions get answered in this column and garner the questioner with a nifty MCPmag.com baseball-style cap.

When you send your questions, please include your full first and last name, location, certifications (if any) with your message. (If you prefer to remain anonymous, specify this in your message, but submit the requested information for verification purposes.)


Maria, let me first address C-DillaSrv service and its dependencies, then I will talk about files that are used by a specific service.

C-DillaSrv is not considered by security experts to be a security risk or spyware. It's license management software from MacroVision that offers copy protection. This service is usually installed by another program, such as 3D Studio Max, AutoDesk, or a PC game. The CDANTSRV.EXE file associated with this service is located in the C:\WINDOWS\system32\DRIVERS folder.

If you run Task Manager you will see the CDANTSRV.EXE as a system process. This process offers anti-piracy protection for software products such as AutoCad and TurboTax, so people won’t copy or distribute software illegally. Unfortunately, the service has no description at all in the Services Microsoft Management Console (MMC) which raises suspicions (see Figure 1).

Services MMC
Figure 1. C-DillaSrv has no information for us to determine what it does, at least when we look in the Services MMC.

You can disable a service in Services console but it will not delete the service. To manage Windows services you can use a resource kit utility called SC, which I believe is installed by default in Windows XP. The SC tool (sc.exe) is a command-line utility used for communicating with the NT Service Controller and services. Among other things, you can use SC to remotely create and start a service from the command line, delete a service from the registry, stop, pause, or query the status of a service. Check out Microsoft’s KB article 251192, "How to Create a Windows Service Using Sc.exe," for more information.

One thing I don’t like about the Services MMC is that it only shows three service states: started, stopped, and paused. What it doesn’t show you is other service states such as start pending, stop pending, pause pending, and continue pending. You may have noticed that sometimes when you try to stop a service, it hangs. The Services console may show you that the service is stopped, but if you run “net start” at the command prompt the service will be shown as running. To avoid any confusion, use the SC tool to determine the true status of a service.

So, to document the status of all the services running on your computer in a file called svcstatus.txt, type:

sc query > svcstatus.txt

To delete a service, type:

sc delete service_name

where service_name is the name of the service you want to delete. Keep in mind; this will completely remove the service from the registry. If you want to temporarily disable a service, use the Services console.

As far as figuring out all the DLLs that are associated with a particular service, you might want to use the following batch file written by Mark Burnett. Save the following text in Notepad as svcdep.bat:

@set imagepath=
@FOR /F "tokens=3" %%a in ('reg query
HKLM\system\currentcontrolset\services\%1
  /v imagepath 2^> nul ^| find "imagepath" ') DO @set imagepath=%%a
@if defined imagepath (
@echo Dependencies for %imagepath%:
@call depends /a0f1c /oc:~svcdep.tmp "%imagepath%"
@FOR /F "tokens=1 delims=, skip=1" %%b in ('type ~svcdep.tmp ^|
findstr /B /c:"," ^|
  findstr /V /c:"?" ^| sort') do @echo %%b
@del ~svcdep.tmp 2>nul
) else (
@Echo '%1' is not installed or is not a valid service
)

To run the batch file, use svcdep.bat with the short file name of the service. The short file name for Remote Access Connection Manager is RasMan (see Figure 2).

Remote Access Connection Manager Properties
Figure 2. It's the Remote Access Connection Manager, but you can call it RasMan for short.

To view the dependencies for C-DillaSrv service, type this:

svcdep.bat c-dillasrv

Your result may look something like this:

C:\Batch> svcdep.bat c-dillasrv
Dependencies for C:\WINDOWS\system32\DRIVERS\CDANTSRV.EXE:
"c:\windows\system32\drivers\CDANTSRV.EXE"
"c:\windows\system32\GDI32.DLL"
"c:\windows\system32\KERNEL32.DLL"
"c:\windows\system32\NTDLL.DLL"
"c:\windows\system32\RPCRT4.DLL"
"c:\windows\system32\USER32.DLL"

There are a couple of interesting things here that I should point out. First, you had pointed out that Services MMC didn’t show any dependencies. This is because Services console only shows you other services that a service is dependent upon. The batch file above gives you a complete listing of all the files used by the service, which you were interested in. Also, even if the service is disabled, that batch file would still show you all the files that are used by the service. The list can be useful if you want to delete files that are no longer needed. With svcdep.bat file you can find out all the files used by all the services and ensure that you are not accidentally deleting a file that was required by a service.

Reader Comments:

Wed, Nov 21, 2007 Anonymous Anonymous

good information and working good too

Wed, May 24, 2006 EXE Anonymous

*********************
my problem is how can i reinstall a service after i uninstall it.
*****************

Tue, Jan 10, 2006 Anonymous Anonymous

Dependency Walker is part of the Support Tools on the Windows CD and is also available with the Resource Kit.

Tue, Jan 10, 2006 Kevin Wood Florida

Good article, however, the line wrapping does make it difficult to cut and paste then use.
Of greater importance, the need for depends.exe was not mentioned. This must be on the computer for the batch file to work. External dependencies must be covered somewhere in an article.

Wed, Dec 28, 2005 Anonymous Anonymous

As always, thanks for the useful information.

Tue, Dec 27, 2005 Anonymous Anonymous

This article was a lot of help!

Tue, Dec 27, 2005 Anonymous Anonymous

Dean makes a good point. The last sentence of the article has a clear warning about that.

Tue, Dec 27, 2005 Dean Florida

You might want to point out that some of the files listed are needed by the OS such as kernel32.dll and gdi32.dll. Therefore don't just blindly delete any and all files listed by this script.

Sat, Dec 24, 2005 Anonymous Anonymous

I tried the last fix with the different line breaks; still doesn't like 'depends' ... should it be in quotes [single? double?]maybe? I also would like to get this working ... does anyone have a reference for writing batch files?

Wed, Dec 21, 2005 Anonymous Anonymous

Problem with this is simply the line wrapping which is hard to show in this format.
This batch file has TEN lines; try this:
LINE 01) @set imagepath=
LINE 02) @FOR /F "tokens=3" %%a in ('reg query HKLM\system\currentcontrolset\services\%1 /v imagepath 2^> nul ^| find

"imagepath" ') DO @set imagepath=%%a
LINE 03) @if defined imagepath (
LINE 04) @echo Dependencies for %imagepath%:
LINE 05) @call depends /a0f1c /oc:~svcdep.tmp "%imagepath%"
LINE 06) @FOR /F "tokens=1 delims=, skip=1" %%b in ('type ~svcdep.tmp ^| findstr /B /c:"," ^| findstr /V /c:"?" ^| sort') do @echo %%b
LINE 07) @del ~svcdep.tmp 2>nul
LINE 08) ) else (
LINE 09) @Echo '%1' is not installed or is not a valid service
LINE 10) )

Or, as was mentioned by another post, check out the free utilities from SysInternals.com - either "Process Explorer" or "PsService" will help.

Wed, Dec 21, 2005 Anonymous Anonymous

batch doesn't run properly as listed

Tue, Dec 20, 2005 Anonymous Anonymous

The first and likely easiest thing to do is to run Process Manager from SysInternals, which will show the vendors for all the processes running.

Tue, Dec 20, 2005 Anonymous Anonymous

I tried this batch file.
However I get a message that goes :
C:\WINDOWS\system32>c:\temp\svcdep.bat rasman
Dependencies for %SystemRoot%\system32\svchost.exe:
'depends' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the file specified.

Do I need another utility called "Depends" ?
Please let me know for if I get this working it would help me a lot in my task of packaging applications.

Smita

Add Your Comment Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above