windows 上的引导顺序:服务与计划任务?

Boot order on windows: Services vs scheduled tasks?

我们将软件部署在 VHD 驱动器上,我们使用 diskpart 加载该驱动器并挂载为驱动器。目前我们使用 schtasks.exe 在系统重启时重新挂载驱动器。

问题:我们可以使用sc.exe添加一个自动服务,该服务驻留在虚拟硬盘上吗?

换句话说,启动时添加服务的顺序是什么?

如果我无法使用 schtasks.exe 在服务 运行 之前添加挂载任务,我该怎么做才能确保服务启动(假定 exe 位于 VHD 上). (实际上,它是一个 nodejs 应用程序,我正在查看 windows-services 包来启动它)。

目标机器:Windows 2008R2,64 位。

schtasks.exe 使用名为 Task Scheduler 的服务,
您可以尝试将其作为依赖项添加到您的自动服务中。

When the computer starts, it uses this entry to verify that the service or services listed in this value ("DependOnService") are started before attempting to start the dependent service.

Read this KB for more information.

为了解决 "VHD - Auto-mount at Startup" 问题,有一个小型便携式免费软件 "Startup diskpart command" 它使用服务方法并且非常易于使用:

  1. 以管理员身份右键单击 Diskpart_svr.exe 和 运行
  2. 编辑第一个命令并使用安装服务按钮,如果要卸载它只需使用卸载按钮 下载: http://www.sordum.net/forum/download/file.php?id=93