Is it possible to perform Windows boot-time actions before paging is enabled?

1

1

I would like to perform some actions at Windows boot time before paging is enabled. I know I can run startup scripts with Task Scheduler or with group policy startup scripts.

My question is whether it's possible to guarantee that my script runs before paging is enabled. I want the script to decide whether to use encrypted paging or not at boot time. So my script would decide whether to do this: fsutil behavior set encryptpagingfile 1 or this: fsutil behavior set encryptpagingfile 0

so that when paging is enabled (after this script), it would be encrypted or not depending on whether the script turns it on or off.

Thanks.

Scott

Scott M. King

Posted 2015-02-11T01:52:11.073

Reputation: 13

this is not possible. The pagefiles are created/used too early in boot process – magicandre1981 – 2015-02-11T05:49:23.243

2I assume by "before paging is enabled," you mean "before the page file is enabled". The OS begins using virtual memory (which implies using memory pages) extremely early in the process, long before it has come anywhere close to mounting a filesystem. – Michael Fenn – 2015-02-11T06:07:03.463

Answers

1

It's possible, but you must write your program to directly use the Native API instead of Win32, similar to the way PageDefrag and the built-in filesystem checker (AutoChk) were written. (Yes, this implies writing it in C rather than batch scripts.)

...And, of course, "before paging is enabled" is way before Windows even touches the network, so the latest group policies won't have been fetched yet.

user1686

Posted 2015-02-11T01:52:11.073

Reputation: 283 655