How do I make a batch file run before logon like chkdsk does?

Posted on

Problem :

I made a simple batch file double password security system for my pc that also displays my number I. Case it gets lost. How do I run this in a full screen command prompt right after the boot screen like chkdsk runs? I tried Task Scheduler. Windows 7 Ultimate SP1.

Solution :

Chkdsk is a native application which must be started by adding it to the key BootExecute under HKLMSystemCurrentControlSetControlSession Manager in the Registry. So create your own application and add it to the BootExecute value.

Comment by magicandre1981 seems to say that BAT cannot be converted to exe and used in the BootExecute. My own experience however, says differently. When searching for bat2exe type of tools (like http://www.scriptcode.com/battoexe) you just need to make sure, that the resulting exe is a valid console application, and it can be used.

Also, to my knowing, there is no requirement for native code to be written in C in order to work with this method. Personally, I have used freepascal-written console application with BootExecute successfully. I think that programming language is irrelevant.

Leave a Reply

Your email address will not be published. Required fields are marked *