I try to automatically log the startup and shutdown times of my Windows Client (Windows 7 and newer) to a log file for later analysis.
Therefore I created a task in Task Scheduler which executes the following statement.
echo %date% %time% >>"C:\Temp\time_logging.log"
The triggers are "on system startup" and "on event" (for shutdown). As event I have chosen option "minimal/basic", source "eventlog" and event id "6006".
The startup is logged, but the shutdown isn't logged. The task is executed with "local service", the permission on the log file and folder is "local service" is "modify" (read, write, modify).
Do you have any clue what I'm doing wrong? Perhaps I choose an event, when the system has no more possibilities to write to file? But what event can I use for this scenario?