Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that there are a lot of applications (such as that ones which manage partitions like Partition Magic, Partition Logic, Easeus, etc) that start even before Windows starts to load itself (the session manager I mean).

These apps load, do their requested job and "pass the token" to Windows again. How do these aplications do it? Is there a way to do something like that in a application?

share|improve this question
Depends on what you mean by "before", some are loading code from the Master Boot Record. – Moab Jun 15 '11 at 15:21
As I mentioned, I mean before Windows Session Manager. – Diogo Jun 15 '11 at 16:21
"before the Session Manager runs" is not the same as "before Windows starts to load itself". The two are quite different parts of the Windows NT 6.x boot process. – JdeBP Jun 15 '11 at 16:57
@JdeBP: "such as that ones which manage partitions like Partition Magic" – Diogo Jun 15 '11 at 17:29
Both Moab and DM8 have already explained to you why that wasn't a useful example. Indeed, Partition Magic doesn't run at either of the points in the process that you've asked about, since it doesn't run before Windows "starts to load itself" nor before the Session Manager runs. The point remains that your question was vague and both it and your repetitions of it are self-contradictory. – JdeBP Jun 15 '11 at 18:39
up vote 12 down vote accepted

This Sysinternals article explains the registry entry involved. But the application cannot use any of the "subsystem" APIs such as Win32 (others are the POSIX and OS/2 APIs). It must use the mostly undocumented NT "native" API. The great majority of applications developed for Windows aren't pure native API apps.

share|improve this answer
Thought I read somewhere that it was killed in Vista. Edited to correct. – LawrenceC Jun 15 '11 at 16:34
Very good link. Extremely informative. – MBraedley Jun 15 '11 at 20:30
Win32subsystem is part of session manager, so you need to rewrite your vague – Moab Jun 15 '11 at 21:21

How can I start a program even before Windows?

I believe you are asking the wrong question (In which case, look at start menu > startup, or msconfig).

However, just in case you really do mean what you asked:

What kind of 'program' would you be referring to?

Are you referring to a different Operating system?
Look at GRUB/GRUB2/any other boot loader

Are you referring to a DOS application (ie some sort of old inventory/customer manager)?
Are you using win9x? That's the only situation when a DOS application would make sense insofar as 'loading before windows' is concerned.
If you're not using win9x, then you probably want to multi-boot.

Are you referring to a Windows application? (as in graphical user space application?)
The simple answer is No. (You can have it startup along with windows, just not BEFORE it.)

Are you referring to auto-starting a Windows Service/daemon/something that sits in the background?
Sure; just set it to start by default. ie if it's already defined as a service, go in control panel > administrative tools > services.
If it's not already defined you can add it.

Are you actually referring to a 'program' running before windows (ie windows xp/vista/7)?
Could you please give an example of something that would need to do that?
Other than boot loaders, disk encryption software or perhaps recovery environments (ie GRUB, truecrypt's boot loader, or any of the many flavors of recovery software).

share|improve this answer
The title isn't very descriptive, but there is an example in the question. – MBraedley Jun 15 '11 at 14:10
I have used partition magic in the past, but iirc that was on a bootable CD. – DM8 Jun 15 '11 at 16:00
Partition Magic can be fully installed (I've done it before). It's when it's fully installed and changes are made in the partition table that the question refers to. The computer restarts and Partition Magic goes about its business before Windows is fully loaded and running. There's some anti-malware software that will do this too. – MBraedley Jun 15 '11 at 20:27
@ MBraedley: agreed, but that was win9x era stuff, is that still valid today? (Yes I'd like to know, just for the trivia of it) ... also, booting pm8 from the cd media was a much more straightforward solution when you wanted to edit the boot drive/partition. Personally, I've used a liveCD w/ gparted the past several years for that task. Anyways, I'm starting to think the OP's question is probably development related, something which ultrasawblade caught on to, and I didn't :) – DM8 Jun 15 '11 at 21:32
If you want to know, follow the hyperlink in my first comment to the question and read. The answer is there. (-: – JdeBP Jun 15 '11 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .