how to execute a program BEFORE windows starts ??

S

Sagaert Johan

Do'nt tell to use autoexec.bat ,since this does not wotk under NT

I want to run a console program before windows starts up.
Regards
Johan
 
H

Herb Martin

On Windows 2000 class machines you can use the Startup
(batch file.)

Edit your Group Policy object (GPO) or the LGPO (Local GPO)
for these machines to include a Startup program in the Computer
section.

Works for ONE machine (LGPO) or many machines (Domain or
OU GPO -- even Sites.)

I use one of these to email me when my "dedicated Web server"
(rented at an ISP) is booted.

You say "before Windows starts" -- this is pratically in possible,
so one presumes you mean on startup before the User can log
on.

If you really mean "before start" then you will have to much around
with a custom Boot Sector/program that performs some action then
boots the OS. (It's been done, but it's not pretty unless you are a
system level programmer.)
 
S

Sagaert Johan

i found that many .tmp files are left behind on the system, and i woumd like
to write a small program to clean these up , before some get locked by the
os.

i see that some install programs replace system dll's the moment windows
boots ,otherwise they are locked .
or should i place something in the runonce registry key ?
 
H

Herb Martin

i found that many .tmp files are left behind on the system, and i woumd
like
to write a small program to clean these up , before some get locked by the
os.

Actually, TEMP files from the previous boot almost
never get locked on the next boot -- most of the files
in temp are from applications and the OS isn't usually
(directly) involved with them.

I do this -- and it works fine even while the OS is
running and files are locked:

rd "%temp%" /s /q
if not exist "%temp%" md "%temp%"

The above is pretty 'violent' but all it does is kill the entire "temp"
directory tree and then recreate then re-create the directory if
it worked.

If you use CORRECT (tight) permissions you also need to add
something like:

REM Following untested, but should be the correct idea:
cacls "%temp%" /t /p Administrators:F "creator owner":f
cacls "%temp%" /e /p "Authenticated Users":C
i see that some install programs replace system dll's the moment windows

No, an application should not be "replacing" system DLL
(especially not on each boot).

How do you "see" this?
boots ,otherwise they are locked .

If they are OPENED then yes, Exe and DLL files are locked;
sometimes you can rename them so that they will never work
again (BE CAREFUL) though.
or should i place something in the runonce registry key ?

What applications interfere with your machine BEFORE you
can logon?

There is something odd going on here....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top