Run before Windows starts

  • Thread starter Thread starter Ger
  • Start date Start date
A batch file? No.

You can run certain programs under very limited conditions after SMSS starts
but before the rest of the OS loads. Look in
HKLM\System\CurrentControlSet\Control\Session Manager\BootExecute.

But the Win32 API is not available at that time in the boot process, and the
CMD window runs under Win32, so there's no way to run a batch file.

What, exactly, are you trying to accomplish?

-Matt
 
I am not aware of any method to launch a batch file prior to Windows
loading.

Regards,

Ken Simmons

Microsoft Technical Support for Platforms and Business Applications
 
I want to replace shdoclc.dll with an edited version. I
had to replace the 403 error so when users try to access
forbidden web pages they are told WHY they can't access
the page.

I know I can startup in safemode and do it BUT I need to
do some remotely.
 
Windows File Protection will replace your edited version with the OS
version. So you won't be accomplishing anything doing this anyway.

There's a mechanism to copy files at boot time built in to the operating
system, so you don't need a batch file. MoveFileEx() has a flag to wait
until reboot to copy the file (MOVEFILE_DELAY_UNTIL_REBOOT). If you weren't
replacing an operating system file, this would work. However, you want to
replace an operating system file, which will cause Windows File Protection
to immediately overwrite your edited file with the OS version of the file.

Replacing operating system files is a bad idea and Microsoft is working hard
to ensure that you can't do this. Replacing operating system files breaks
things. (Like other peoples' applications.)

Why don't you use Internet Services Manager to change the error that a 403
returns to the client? (I know this can be done in the Server products; I
must confess I've never used web services on the Pro products and am only
assuming it can be done.) That would be a much easier and cleaner solution.

-Matt
 
Back
Top