New
#11
The calculation of up time is very simple. Take the current time and subtract startup time. Any process that wants uptime would do the calculation itself. That is what Task Manager does. The startup time can be obtained in various ways. Where the start time is stored is undocumented but I suspect it is in kernel address space which is inaccessible to normal processes. The kernel would need this information and it would want it in a place not subject to meddling by processes.
I don't see any practical way to do what you want. You need to rethink the problem and come up with some other solution.
More investigation did not turn up a location in the registry, just a variety of ways to retrieve the information:
net statistics workstation | find "Statistics since"
systeminfo | find "System Boot Time"
wmic os get lastBootUpTime (results in milliseconds)
As I said previously, I suspect that startup time is stored in Kernel address space. There are multiple ways to access this but they all ultimately get it from the same place. But wherever it is you can be very sure there is no provision for user level code to change it. Allowing this to be modified by the user or an application would be a really bad idea. System uptime is used by the kernel, the performance monitoring system and other Windows components. Some applications use it as well.
As a matter of interest the startup time is accessible in the registry in a special top level key. Regedit and similar utilities by design will not access it but applications can do so. I don't know the address and I will not take the time to investigate. And it cannot be changed.