Jump to content

Closing Windows Services.


ame1011
 Share

Recommended Posts

Maybe it's the lack of sleep, maybe it's cause i'm dumb. Either way, I've looked everywhere and cannot seem to find the functions that close windows services. I've seen the process functions but what i'm looking for is services. Do any such functions exist? If so where can I find them?

EDIT:

I've found the following...

Func ServiceExists($szService)
    RegRead("HKLM\SYSTEM\CurrentControlSet\Services\" & $szService,"DisplayName")
    Return Not @error
EndFunc

What exactly does this return? @error if there is no such service? And nothing if it exists?

Edited by ame1011
[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Maybe it's the lack of sleep, maybe it's cause i'm dumb. Either way, I've looked everywhere and cannot seem to find the functions that close windows services. I've seen the process functions but what i'm looking for is services. Do any such functions exist? If so where can I find them?

EDIT:

I've found the following...

Func ServiceExists($szService)
    RegRead("HKLM\SYSTEM\CurrentControlSet\Services\" & $szService,"DisplayName")
    Return Not @error
EndFunc

What exactly does this return? @error if there is no such service? And nothing if it exists?

It returns the service Displayname from the shortname used also by the registry keyname.

ServiceExists('ImapiService')

should return IMAPI CD-Burning COM Service

And you would right with your last questions of what error does.

With services, the Net command can help. sc.exe can manipulate services (XP has it).

Edit:

Example of stopping a service

RunWait(@ComSpec & ' /c Net Stop ImapiService', '', @SW_HIDE)
Edited by MHz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...