Jump to content

Execute a dos program as soon as possible on boot?


Recommended Posts

Posted

I have a commandline program that I want to execute on every boot (hdparm with some parameters, not decided yet on all, I just know I need - B 254 to stop the annoying HDD head parking clicks). The OS is Server 2003 used as a workstation.

Where to put it so it gets executed as soon as possible? From googling I think hklm/run, but maybe there's another more suitable place (I haven't found definitive info on startup order - does autoexec.bat come sooner or later)?

Thanks.

GL


Posted

Setting it as a Machine Startup script in computer policy (gpedit.msc) is as soon as you're going to run this, unless you wish to do some research into how to run a command at boot time (like as seen with defragmenter program's boot time defrag, or pagedefrag from sysinternals).

Posted

Windows NT only passes autoexec.bat for environment variables. You can't launch a DOS app from there.

The earliest you could launch a DOS app is at T39 (which is where the system environment is up and running, but the users are not yet created. In an install from cdrom, this happens after the post-character reboot. In a setup started by winnt32.exe, it is the reboot after the files are copied to the fixed disk.

Posted (edited)

I'm not asking about unattended, just everyday usage. Anyway, with this particular program it doesn't matter (i've put it in user's start menu startup), but I have another one that I want to be started as soon as possible. Also, I want to try my ideas of rearranging the order of startup programs.

I couldn't find definitive info on the exact startup order - for example, some kind of table - where it would say hklm/run first, then hklm/start menu, then hkcu/run... then startup scripts... then logon scripts...

Or maybe it isn't guaranteed - there is some paralelism and there is no guarantee which will come first? I often see the order of the tray icons changed in consequent reboot (and there is no icon hiding here :)) so that would mean some of the programs started faster/slower than before. One factor for this could be drive fragmentation, for example.

But, when I think about it, something has got to come first. :unsure:

I've read there are programs for this, but they insert delays - and I don't want that.

GL

* Edit - and what about the order of several items in one place (start menu, for example)? Who gets executed first? I read there is also no guarantee for this.

Edited by GrofLuigi

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...