April 18, 2024, 03:41:12 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Understanding the windows registry - Controlling startup

Started by Andy, June 29, 2017, 02:38:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

As I like to work backwards for some reason, I will now show you about the startup process for programs and services.

So lets begin with programs that start when you log on:

There are two keys to note
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run contains programs that start when YOU log on.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run contains all the programs that start when windows starts regardless of which user logs on.

These are sting values and for Avast anti virus for example are like this:
String name AvastUI.exe and the value is "C:\Program Files\AVAST Software\Avast\AvLaunch.exe" /gui

So when you go to startup (task manager) or msconfig (startup tab / selected items) you will see both the programs that start for you AND the programs that start when windows starts.

Looking at both these registry keys from time to time is a good idea as you can delete out any unwanted programs from starting.

Now Services:
A service is simply a program that can start when windows starts - say to check for an update for a particular software package.

There are two types of services - Critical on Non Critical.
The Critical services start straight away as they are deemed necessary for windows to work correctly.

Non Critical services are not vital to windows and typically can be installed by a 3rd party software.

These Non Critical services are set to start 2 minutes after windows starts by default - so how (if we want to) can we control when they will start?

The registry of course is the answer.

Every service that has a delayed start has an entry placed in the registry here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service name>

The entry is a Dword called DelayedAutostart and has a value of 1.

We have two options:
1. Tell windows when to start all non critical services at the same time.

At this key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control we place a Dword called AutoStartDelay and set its value in milliseconds 120000 (12 second delay).

This will cause all delayed services to start 12 seconds after windows starts.

2. Tell each specific service when to start.
For each of them, go to their registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service name>

Create a new Key called AutoStartDelay so you have:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service name>\AutoStartDelay

In this key, place a Dword called AutoStartDelay and set it in milliseconds e.g. 120000 (12 seconds).

If this doesn't work simply place the Dword in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service name>

So with these two parts of the registry, you can control what programs start and when non critical services start.

Andy.





Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.