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 ?
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.
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 ?
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?)
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 ?