0

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

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

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

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

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

4

2 回答 2

2

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

当计算机启动时,它使用此条目来验证在此值中列出的一个或多个服务(“DependOnService”)是否已启动,然后再尝试启动从属服务。

阅读此知识库以获取更多信息。

于 2015-05-21T21:44:09.870 回答
1

to solve the "VHD - Auto-mount at Startup" problem there is a small portable freeware "Startup diskpart command" it uses service methode and very easy to use:

  1. Right click Diskpart_svr.exe and run as admin
  2. Edit the first command and use install service Button , if you want to uninstall it just use uninstall button Download: http://www.sordum.net/forum/download/file.php?id=93
于 2015-05-22T08:09:18.047 回答