98204
Goto Top

Läuft ein Dienst?

Hallo zusammen,

kann mir jemand einen Tipp geben wie ich feststellen kann, ob ein bestimmter Dienst läuft oder nicht?
Gibt es dafür ein Hilfsmittel das in Windows integriert ist? Ich möchte nämlich nichts programmieren müssen.

Danke im voraus für jede hilfreiche Antwort.
Der Internetter

Content-Key: 218160

Url: https://administrator.de/contentid/218160

Printed on: April 18, 2024 at 10:04 o'clock

Member: SlainteMhath
SlainteMhath Sep 30, 2013 at 11:30:35 (UTC)
Goto Top
Moin,

Interaktive oder im Batch?
Interaktiv wäre "Services.msc" und Batch "sc.exe"

Was willst du denn erreichen?

lg,
Slainte
Member: lenny4me
lenny4me Sep 30, 2013 at 12:10:30 (UTC)
Goto Top
Hallo,

dann schreib ichs noch via powershell
$Computer = "Servername"
Get-Service -computername $Computer -DisplayName "meinDienst"

Grüße
Mitglied: 98204
98204 Sep 30, 2013 at 13:36:04 (UTC)
Goto Top
Ich will das im Batch haben.
Danke für den Tipp mit sc-Kommando.
Member: lenny4me
lenny4me Sep 30, 2013 at 13:55:34 (UTC)
Goto Top
So sei es denn face-big-smile
Member: colinardo
colinardo Sep 30, 2013, updated at May 12, 2014 at 11:50:50 (UTC)
Goto Top
Zitat von @98204:
Ich will das im Batch haben.
z.B. so
sc query "ServiceName" | find "RUNNING"  
if "%ERRORLEVEL%"=="0" (  
    echo Service läuft
) else (
    echo Service läuft nicht
)
oder kürzer so:
sc query ServiceName | find "RUNNING" && echo Dienst laeuft || echo Dienst laeuft nicht  
Grüße Uwe
Mitglied: 98204
98204 Sep 30, 2013 at 15:53:28 (UTC)
Goto Top
@colinardo: Danke ... super