Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dienste per Batch stopen/ starten

Empfohlene Antworten

Veröffentlicht

hallo,

ich möchte eine Batch Datei schreiben, bzw habe ich schon gemacht die einen bestimmten Windows Dienst startet wenn er noch nicht läuft (das soll erst getestet werden) und umgekehrt. So eine art Schalter der also den zustand genau umkehrt.

Hier mein Versuch

Mit google kommich leider auch nicht weiter,...

@echo off

if %errorlevel% == 10 echo the service ist already running.stopping...

net stop "IMAPI CD-Burning COM Service"

if %errorlevel% == 0 echo Service started successfully.

net start "IMAPI CD-Burning COM Service"

echo Errorlevel: %errorlevel%

pause

Filter die Ausgabe von "sc query" entweder über einen find-Befehl (und dann %errorlevel%L) oder über sc-Paramter direkt.

Also danke aber ohne Beispiel wäre ich da nicht weitergekommen.

habe es nun wie folgt und funzt!

@echo off

@echo.

@echo ############ Dienst starten/ stoppen ############

@echo.

REM set errorlevel=200

REM sc query ImapiService

sc query ImapiService | find /i "running"

if "%1%" EQU "start" goto start

if "%1%" EQU "stop" goto stop

if "%errorlevel%" EQU "0" goto stop

if "%errorlevel%" EQU "1" goto start

REM echo %errorlevel%

:stop

net stop ImapiService

goto ende

:start

net start ImapiService

goto ende

:ende

pause

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.