0

How do i run task at boot time and wait for it's completion? I know chkdsk and some other programs are doing that, but how? Update: i found a way. Native API, if anyone's curious.

YaD
  • 59
  • 6
  • 1
    If you found a solution then post it as an answer. Just saying you have a solution without saying what it is helps no one. – Carey Gregory Feb 10 '12 at 19:15

2 Answers2

3

Windows have a "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute" key, programs in it are executed before any subsystem is started, i.e. before win32,LSA, etc. The only API avaliable at that time is NativeAPI. Most of it's functions can compromise security and stability of the system (This API can close handles, hide registry keys and more). Of course, a lot of it's functions are undocumented, but guys at http://undocumented.ntinternals.net/ have documented a lot of them.

YaD
  • 59
  • 6
1

Here is another method (not sure if this "Native API" is the same but you can use the Windows Task Schedular. There is a On Computer Start on or a User Login option too.

How to install/wrapper (Just for more info): Windows Task Scheduler Installer

Community
  • 1
  • 1
Brad Semrad
  • 1,501
  • 1
  • 11
  • 19