Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 To: A QP
  Where is A QP?
 JHB
 South Africa
 A QP
 Tags
Subject: RE: Net Start , Net Stop
Thread ID: 50976 Message ID: 50985 # Views: 4 # Ratings: 0
Version: Not Applicable Category: Win32API programming
Date: Tuesday, September 07, 2004 5:41:24 PM         
   


Probably you can do something similar to this. For Sophos Anti-virus on Windows NT I did:

*---------------Stop Sophos Anti-Virus Service
lltest=.t. && (appropriate Conditions go here)

IF lltest
locomputer = getobject("WinNT://"+LEFT(SYS(0),AT(" ",SYS(0))-1)+",computer")
for each loservice in locomputer
WITH loservice
if upper(.Class) = 'SERVICE' ;
and "SOPHOS"$upper(.displayname) AND .Status = 4
.Stop
ENDIF
endwith
ENDFOR
ENDIF


* program body goes here ......

*---------------Turn on Sophos Anti-Virus Service
IF lltest AND TYPE("locomputer")="O" AND NOT ISNULL(locomputer)
for each loservice in locomputer
WITH loservice
if upper(.Class) = 'SERVICE' ;
and "SOPHOS"$upper(.displayname) AND .Status # 4
.Start
ENDIF
endwith
ENDFOR
locomputer=.null.
ENDIF



> Hi All
> Does anyone know if there is a API call to start and stop a service?
> Thanks
> A


ENTIRE THREAD

Net Start , Net Stop Posted by A QP @ 9/7/2004 3:18:06 PM
RE: Net Start , Net Stop Posted by Pete Sass @ 9/7/2004 5:04:46 PM
RE: Net Start , Net Stop Posted by Yuri Rubinov @ 9/7/2004 5:41:24 PM
RE: Net Start , Net Stop Posted by Ken Blum @ 9/7/2004 6:02:49 PM
RE: Net Start , Net Stop "Yuri" Posted by Pete Sass @ 9/7/2004 6:46:53 PM
RE: Net Start , Net Stop "Yuri" Posted by Yuri Rubinov @ 9/7/2004 9:48:23 PM
RE: Net Start , Net Stop "Yuri" Posted by Mz @ 9/11/2004 5:41:50 AM
RE: Net Start , Net Stop "Yuri" Posted by Yuri Rubinov @ 9/11/2004 8:12:57 PM
RE: Net Start , Net Stop "A" Posted by A QP @ 9/13/2004 4:42:25 PM
RE: Net Start , Net Stop Posted by Yuri Rubinov @ 9/7/2004 9:43:06 PM
RE: Net Start , Net Stop Posted by Mz @ 9/9/2004 9:38:59 AM