CMD Commande to Arrêt PC AND do mise à jours

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

CMD Commande to Arrêt PC AND do mise à jours

Message par Clippy »

We have some Win7 Machines that ne use the shutdown Button but a custom Tool that checks for online PCs and shuts down the NAS si cela is the last one online. Tout fonctionne fine but I use the command `Process.Start("shutdown", "/s /t 0");` to shutdown the pc and it seems that this ignores pending mises à jour. This results dans le PC automatiquement shutting down some day while doing important stuff sans saving.

Question how can the command be modified to do mises à jour and shutdown à la place of just shutting down. The cmd command serait enough, Je peux translate that into C# avec no problème.

Sorry if this was asked multiple times but J'ai besoin de be absolutely sure that my changes work...
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: CMD Commande to Arrêt PC AND do mise à jours

Message par Clippy »

```
wuauclt /detectnow /updatenow && shutdown /s /t 0

```

Shuts down seulement when mise à jour is over.
Répondre

Revenir à « Performance & Dépannage »