Im working on trying to find a way to detect when windows boots up and i need to capture it using .net and C#. And i dont have an idea on how i should start this. Can someone suggest me on how i should do this?
Asked
Active
Viewed 74 times
-1
-
1What means *capture*? I understand it as if you want to run your application. If you just need the time, then see [here](https://stackoverflow.com/q/7407286/1997232). – Sinatr Dec 10 '20 at 13:08
-
i need to find the the time and the number of times the system has been booted up by the user. i need to use it in a .net application – LARA Dec 10 '20 at 17:06
-
WMI + Event Log is one way: https://stackoverflow.com/questions/7407286/how-to-know-when-was-windows-started-or-shutdown – Alex K. Dec 10 '20 at 19:45
1 Answers
0
The simplest ways to do so, would be to either
- Add a shortcut from your program in the Windows Startup folder ("C:\Users%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup")
- Or you could create youre program as Service and set the startup type to Automatic

Simon Tribus
- 396
- 2
- 11
-
2Option 1 would only detect the logon of the given user, not a boot up. – Alex K. Dec 10 '20 at 12:37
-
i need to track the time and the number of times the user has booted up the system. i need to use it in an application – LARA Dec 10 '20 at 17:05