How can I shut down Windows from the command line or a MATLAB function in MATLAB?

19 visualizzazioni (ultimi 30 giorni)
I have a program that runs for a long time. I would like to shut down the computer automatically when execution stops.

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 19 Gen 2010
You can shut down Windows from a MATLAB function or the MATLAB command prompt by using the following code:
system('shutdown -s')
When using this, keep in mind that it WILL shut down your system unless you call the command again with the "-a" flag in the alloted time. There will be no prompt asking to confirm the shutdown. Also note that this may not work if there are Microsoft Office programs running at the time the shutdown is requested.
For more information on the shutdown operation, type:
system('shutdown /?')
at the MATLAB Command Prompt.

Più risposte (0)

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by