Results 1 to 5 of 5

Thread: NT SERVICE Starting & Kill procs & Scheduler ???

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    13

    NT SERVICE Starting & Kill procs & Scheduler ???

    Hi,

    I'm trying to figure out how to check for the NT FTP SERVICE running and if it is not running
    it should then start this service.

    Also, I would like to know how I can kill processes as well. What if I know the process executable but it has no window name for example ? Do I need to get the class or is the name of the executable enough ?

    Also very important is, what about processes such as ZoneAlarm or some firewall software. Wouldn't those kind of programs have some sort of security (even if logged in as Administrator I mean) or are they killable in NT as well ?

    Also how do I add certain things to the scheduler ? And is there a better way of starting applications at a specific time rather than scheduler ?

    PS: The scheduler idea must be hidden.


    Thank you,

  2. #2
    New Member
    Join Date
    Mar 2002
    Posts
    7

    Cool

    I give you the fully operational class which can do all you need to do with a service - query the status, start, stop and send a command. Killing of services is not wise, you can stop them if that's what you wanted.
    You are free to customize the code as you want.
    Attached Files Attached Files

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    13
    Private Declare Function StartService Lib "advapi32.dll" Alias "StartServiceA" (ByVal hService As Long, ByVal dwNumServiceArgs As Long, ByVal lpServiceArgVectors As Long) As Long

    So could you give me an example of what values I would put into this function ?

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    7
    I gave you the class which you can use as it is. You don't use API's declared inside of the class as PRIVATE ! You use public methods of the class like this:

    dim Service as Service
    set Service=new Service
    Service.Init "Machine_name", "Service_name"
    if not Service.IsRunning then Service.ServiceStart
    ...
    Service.ServiceStop
    ...

    All you have to do is to include this class in the project and use it's public methods (familiar with encapsulation?)

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    13
    Uhm No I do not know what you mean.
    See ... I'm very very very new to VB, I code in C and have no clue of VB because I've barely ever had any use for it (Dont like windows).

    Would you be able to send me an example using this for example starting up the FTP service with it ?

    Would be greatly appreciated ,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width