从命令提示符关闭窗口是否会导致损坏?

我们大多数人使用“开始”菜单来关闭Windows系统,但如果您选择使用命令行,是否可能造成损坏?有没有什么特别的命令会造成损害而其他命令不会?今天的超级用户问答帖子回答了一位忧心忡忡的读者的问题。...

从命令提示符关闭窗口是否会导致损坏?

我们大多数人使用“开始”菜单来关闭Windows系统,但如果您选择使用命令行,是否可能造成损坏?有没有什么特别的命令会造成损害而其他命令不会?今天的超级用户问答帖子回答了一位忧心忡忡的读者的问题。

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

由Acid Pix(Flickr)提供的屏幕截图。

问题

超级用户读取器FlipFloop想知道使用Windows CMD关闭计算机是否会造成损坏:

When you launch shutdown -i to shut down a computer via the command prompt (CMD), does it damage the computer that is being turned off (either locally or remotely)?

使用Windows CMD关闭计算机会导致损坏吗?

答案

超级用户贡献者Marco Bonelli和LPChip为我们提供了答案。首先,Marco Bonelli:

The shutdown command in Windows performs a normal shutdown/reboot/logoff on the computer (locally or remotely). If you closed all of your running programs and saved your files, there is no difference between running any shutdown command (with any parameter) or using the Windows interface via the Start Menu. The command does not damage the computer or file system in any way.

More About Running Programs

If any programs preventing the shutdown are running, Windows will automatically try to terminate them and, if that is not possible, will prompt you about it. The only problem you can have here arises with programs performing unsaved changes to files. If they provide an automatic recovery of improperly closed sessi*** like Microsoft Office for example, they will save their state to recover it on the next start, otherwise you will lose the unsaved data.

接着是LPChip的答案:

No, it will not. When you use the Start Menu to shut down a computer, it will also use the same shutdown command, just with different parameters.

The shutdown -i option was made to expose features that the Windows Start Menu does not offer without use of the Command Line. For example, shutdown -i can be used to send a shutdown command to another computer.

In the same fashion that shutdown -i will not damage your computer, neither will shutdown -s -t 0.

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

Normally, Windows will show you a dialog of some sort like, “There is a program preventing shutdown. Do you want to cancel or continue anyway?” A timeout will eventually abort the shutdown. With the -f option, instead of showing you the message, it will assume that you wish to continue anyway and close any remaining programs.


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-09 13:06
  • 阅读 ( 205 )
  • 分类:互联网

你可能感兴趣的文章

Windows10中7种修复缓慢启动时间的方法

...休眠,因此它不会出现。要启用休眠,请打开管理员命令提示符或PowerShell窗口。您可以通过右键单击开始按钮或单击Win+X并选择命令提示符(Admin)或Windows PowerShell(Admin)来完成此操作。 ...

  • 发布于 2021-03-11 02:02
  • 阅读 ( 262 )

8恼人的windows 10个问题及解决方法

...,请按Windows键+X并选择Command Prompt(Admin)打开管理命令提示符。然后输入以下两行,每行后按Enter键: ...

  • 发布于 2021-03-11 02:55
  • 阅读 ( 313 )

最常见的5个windows错误及其修复方法

... 右键单击开始按钮并选择命令提示符(Admin)。键入此命令以运行文件检查器,这将需要几分钟: ...

  • 发布于 2021-03-15 00:38
  • 阅读 ( 266 )

为什么windows会崩溃?故障排除指南

...。右键单击命令行以管理员身份运行程序。在提升的命令提示符窗口中,键入sfc/scannow并让程序运行。它将扫描并修复所有损坏的系统文件。 ...

  • 发布于 2021-03-17 13:14
  • 阅读 ( 327 )

如何修复windows update错误0x80070057

... 右键单击“开始”菜单并选择“命令提示符(Admin)”,打开提升的命令提示符。现在运行以下命令: ...

  • 发布于 2021-03-17 19:13
  • 阅读 ( 355 )

如何在没有任务管理器的情况下强制关闭程序

...管理器的程序,可以使用taskkill命令。通常,您会在命令提示符下输入此命令以终止特定进程。然而,每次程序停止响应时打开命令行窗口是很笨拙的,每次输入命令都是一种浪费。使用快捷方式可以更轻松地强制关闭窗口。 ...

  • 发布于 2021-03-18 04:22
  • 阅读 ( 274 )

如何删除其他程序正在使用的文件

... 6通过命令提示符强制删除正在使用的文件 ...

  • 发布于 2021-03-18 06:15
  • 阅读 ( 199 )

当时光机备份被扔进垃圾箱时该怎么办

...ilities>Terminal。 按此处所示输入以下命令:csrutil disable;reboot 点击Return并等待Mac重新启动。 SIP现在已关闭;您应该可以正常清空垃圾箱。 完成后,返回第一步并使...

  • 发布于 2021-03-19 02:29
  • 阅读 ( 259 )

windows 10更新后速度慢吗?下面是你可以修复它的方法

... 要运行系统文件检查器,必须使用命令提示符。按照下列步骤操作: ...

  • 发布于 2021-03-27 04:04
  • 阅读 ( 454 )

如何修复Windows10中的“重置电脑时出现问题”错误

... 您必须通过Windows命令提示符sfc/scan命令运行系统文件检查器。 ...

  • 发布于 2021-03-28 04:17
  • 阅读 ( 315 )