Freigeben über

Enabling W32time with a shell command

Anonym
2021-06-07T08:39:48+00:00

Hi there,

i want to enable the Windows time service, W32time, via a shell script since it may be disabled. For testing i disabled the service and ran as admin:

"net start w32time" 

and i also tried:

"sc start w32time"

both fail to start/enable the service. "net start w32time"  reports: "The specified service can't be started. It's deactivated or not connected to a client" (i translated from a German error message so take the error message with that grain of salt.) If i change the start type in the services menu from deactivated to manual, "net start w32time" works fine.

What is the right command to enable the w23time sercive via a shell script?

Thanks in advance

Matthias

Windows für Zuhause | Windows 10 | Leistungsprobleme und Systemfehler

Gesperrte Frage. Diese Frage wurde aus der Microsoft-Support-Community migriert. Sie können darüber abstimmen, ob sie hilfreich ist, aber Sie können keine Kommentare oder Antworten hinzufügen oder der Frage folgen.

0 Kommentare Keine Kommentare

5 Antworten

Sortieren nach: Am hilfreichsten
  1. Ingo Böttcher 158.1K Zuverlässigkeitspunkte
    2021-06-07T17:12:10+00:00

    i want to enable the Windows time service, W32time, via a shell script since it may be disabled. For testing i disabled the service and ran as admin:

    "net start w32time" 

    and i also tried:

    "sc start w32time"

    both fail to start/enable the service.

    Stimmt. Wenn der Service deaktiviert ist, kannst du ihn nicht starten. Er ist ja deaktiviert. Du müsstest ihn zuerst aktivieren.

    sc config W32time start= auto

    Man beachte das Leerzeichen hinter dem Gleichzeitszeichen.

    War diese Antwort hilfreich?

    Eine Person fand diese Antwort hilfreich.
    0 Kommentare Keine Kommentare
  2. Ingo Böttcher 158.1K Zuverlässigkeitspunkte
    2021-06-07T19:59:25+00:00

    Bei mir war allerdings "sc" nicht in der pfadvariablen

    sc.exe liegt in C:\Windows\System32. Wenn dieser Pfad nicht Teil des PATH ist, ist da im System aber irgendwas vermurkst.

    War diese Antwort hilfreich?

    0 Kommentare Keine Kommentare
  3. Anonym
    2021-06-07T19:53:20+00:00

    Ja das war keine Absicht, dachte ich bin im englischsprachigen Forum. In der Doku von W32tm kann ich leider nichts passend es finden. Der einzige Kandidat ist:

    w32tm /config [/syncfromflags:<source>]

    aber für mich liest sich das nicht nach dem starten des Dienstes sondern der art der Zeitsynchronisation. Hab ich etwas übersehen?

    War diese Antwort hilfreich?

    0 Kommentare Keine Kommentare
  4. Anonym
    2021-06-07T19:49:50+00:00

    Super, danke dir. Sowas hatte ich vermutet habe aber in der doku das Stichwort "enable" gesucht und nicht gefunden. In der doku von sc.exe ist es auch schön beschrieben wenn man weiss wonach man suchen soll :) .

    Bei mir war allerdings "sc" nicht in der pfadvariablen musste bei mir also

    sc.exe config W32time start= auto

    heissen, dann ging es auch sofort. Das erklärt auch warum mein erster Versuch mit sc keinerlei Rückmeldung gebracht hat.

    War diese Antwort hilfreich?

    0 Kommentare Keine Kommentare
  5. Anonym
    2021-06-07T08:49:56+00:00

    Hier spricht man Deutsch, die Community auf Englisch ist hier https://answers.microsoft.com/en-us/

    Grundsätzlich ist der Standard-Starttyp für diesen Dienst Manuell

    Alles Weitere findest du in diesem Artikel: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/ff799054(v=ws.11)

    War diese Antwort hilfreich?

    0 Kommentare Keine Kommentare