Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #6247

Re: Check if service is running

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "Uwe Heyer" <uwe.heyer@aristik.de>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Check if service is running
Date 19 Nov 2013 19:04:55 GMT
Lines 46
Message-ID <bf1r2nFknomU1@mid.individual.net> (permalink)
References <528b79ec$0$2349$91cee783@newsreader04.highway.telekom.at>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-15
Content-Transfer-Encoding 7bit
X-Trace individual.net ahIFoyoExJ5IDkINLTJncQ4ODG3n4jhkZG8LSxtJcGS+UkBFeM
Cancel-Lock sha1:KmkFTEcq4qG4IJjC26JaNW/+/E0=
User-Agent XanaNews/1.19.1.320
Xref csiph.com comp.lang.clipper.visual-objects:6247

Show key headers only | View raw


Joe Bench wrote:

> Hi there!
> 
> How can i check if a service on a remote machine is running?
> I can start a service via script, i can stop it. Great.
> But the scipts can not give feedback, if the start/stop fails.
> 
> My client application needs to know, if this service is running or
> not.
> 
> Any ideas?
> 
> kindest regards,
> Joe

Hi Joe,

I can't give you any code sample, you need asking google or MSDN

google for SERVICE_STATUS_PROCESS (== StatusStructure) or may be
defined in VO yet


the short story
hManager := openSCManager(szTarget, Null, SC_MANAGER_ALL_ACCESS)
hService := OpenService(hManger, szServiceName, SERVICE_ALL_ACCESS)
QueryServiceStatusEx(hService,                 
            SC_STATUS_PROCESS_INFO, // get status
            @StatusStructure,                  
            _sizeof(SERVICE_STATUS_PROCESS),   
            @dwBytesNeeded )                   

? StatusStructure.dwCurrentState // SERVICE_PAUSED == 7

CloseServiceHandle(hService)
CloseServiceHandle(hManager)


you need access rights for szTarget 


Ahoj
-Uwe

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Check if service is running Joe Bench <benchjoe@yahoo.de> - 2013-11-19 15:47 +0100
  Re: Check if service is running "Uwe Heyer" <uwe.heyer@aristik.de> - 2013-11-19 19:04 +0000
    Re: Check if service is running Joe Bench <benchjoe@yahoo.de> - 2013-11-20 08:29 +0100
      Re: Check if service is running Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-11-20 09:54 +0100
      Re: Check if service is running "Uwe Heyer" <uwe.heyer@aristik.de> - 2013-11-20 21:20 +0000
        Re: Check if service is running Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2013-11-20 23:02 +0100
          Re: Check if service is running Joe Bench <benchjoe@yahoo.de> - 2013-11-21 08:07 +0100
  Re: Check if service is running dlzc <dlzc1@cox.net> - 2013-11-19 13:36 -0800

csiph-web