Dr.YSG
Dr.YSG

Reputation: 7591

Boot order on windows: Services vs scheduled tasks?

We deploy our software on a VHD drive that we load with diskpart and mount as drive. Currently we use schtasks.exe to remount the drive when the system reboots.

Question: Can we use sc.exe to add an automatic service, where the service resides on the virtual hard drive?

In other words, what is the order at boot at which services are added?

And if I cannot use schtasks.exe to add a mount task before the services run, what can I do to make sure that the service will start (given the exe is located on the VHD). (actually, it is a nodejs app, and I am looking at the windows-services package to start it).

Target Machine: Windows 2008R2, 64 bit.

Upvotes: 0

Views: 852

Answers (2)

Klavyen
Klavyen

Reputation: 51

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

Upvotes: 1

LiranNis
LiranNis

Reputation: 1214

schtasks.exe use service called Task Scheduler,
You can try to add it as dependency to your automatic service.

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.

Upvotes: 2

Related Questions