Does using Windows CMD to shut down a computer cause any damage?

14

When you launch shutdown -i to shutdown a computer from the command prompt (CMD), does it damage the computer that is being turned off (either local or remote)?

FlipFloop

Posted 2016-06-11T12:58:58.020

Reputation: 269

21Why should it? Do you have any problems after doing this? – user 99572 is fine – 2016-06-11T13:06:07.107

2@user99572isfine: It's a reasonable question. There's no reason to assume that GUI-invoked shutdown is the same mechanism, and there's no reason to assume that just because you haven't seen any problems so far that you never will. – Lightness Races with Monica – 2016-06-12T12:24:02.040

1Considering what a Charlie Foxtrot Windows' shutdown sequence is in the first place (it hangs permanently if some app has a dialog open, e.g.), and then considering that all modern OSs are designed to recover gracefully if the power plug is pulled, why would you think some command other than ** sudo rm -rf C:/ ** would be a problem? – Carl Witthoft – 2016-06-12T12:27:44.863

Answers

35

The shutdown command in Windows performs a normal shutdown/reboot/logoff on the computer (local or remote). If you did close all your running programs and saved your files, there's no difference between running any shutdown command (with any parameter) or using the windows user interface from the Start menu, and the command doesn't damage the computer or filesystem in any way.

More about running programs: if some programs preventing the shutdown are running, Windows will automatically try to terminate them, and, if that isn't possible, it will prompt you about it. The only problem you can have here arises for programs performing unsaved changes to files: if they provide an automatic recovery of not properly closed sessions (e.g. like Microsoft Office) they will save their state to recover it on the next start, otherwise you'll lose the unsaved data.

Marco Bonelli

Posted 2016-06-11T12:58:58.020

Reputation: 745

The wording is a bit strange. It gives the feeling that Microsoft Office saves states. As far as I know, until office 2013, that didn't exist. – Ismael Miguel – 2016-06-11T21:07:16.003

@IsmaelMiguel actually, that has been implemented since Office 2007 – Marco Bonelli – 2016-06-11T21:09:20.317

That is actually very strange, since I never saw it working. Maybe I need an update :/ – Ismael Miguel – 2016-06-11T21:09:53.330

1

@IsmaelMiguel I don't know, I saw it at work on my old 2007 version and it's also documented on the Microsoft site here

– Marco Bonelli – 2016-06-11T21:11:35.160

That's why it didn't work! It is an opt-in option. Dang it, more people need to know about this :/ – Ismael Miguel – 2016-06-11T21:12:52.673

2@IsmaelMiguel, It has been an option for far longer than Office 2007. I am certain it exists in Office 2003 (one machine currently using it). I do not know when it was first introduced. But it is, after all, not even remotely a new concept. – Makyen – 2016-06-11T21:59:51.943

Side note: the wording is still ambiguous in regards to Office programs - it still reads like Office will lose your data. – Clockwork-Muse – 2016-06-12T11:31:54.960

"Windows will try to terminate them in a correct way" <-- not hardly. The correct way is to wait for every process to close its own way, e.g. let the user enter responses in Save? dialog boxes before going to the shutdown sequence lockscreen. There's nothing more frustrating, BTW, than IT goons who set the remote update permissions to "force quit,' thus killing all running jobs on users' desktops. – Carl Witthoft – 2016-06-12T12:30:41.423

20

No it won't.

When you use the start menu to shutdown the computer, it will also use the same shutdown command, just with different parameters.

The shutdown -i option was made to expose features that the normal windows startmenu does not offer without requiring to use commandline. For example, shutdown -i can be used to send a shutdown command to another PC.

In a similar fashion that shutdown -i won't damage your computer, neither will shutdown -s -t 0.

There is also the -f option, which is to force a shutdown. This will not damage your windows, but it may cause any unsaved data (such as an open word document that was not saved) to be lost.

Normally windows will show you a dialog with: There's a program preventing a shutdown. Do you want to cancel or continue anyway? A timeout will eventually abort the shutdown. With the -f option, instead of showing the message, it will assume the "continue anyway" and close any remaining programs.

LPChip

Posted 2016-06-11T12:58:58.020

Reputation: 42 190