Search and Read From Windows Event Log
Posted: 19 Jul 2017, 09:13
Hello all,
I'm currently working on a program that I would be able to send to a customer with a single day's use. I've developed a formula based on the current date that returns a passcode, which would in turn be sent to the customer with the program (which will allow them access to a higher level on some specialized equipment for troubleshooting purposes). The next thing I'd like to do is add functionality to the program to prevent the customer from setting the date on their computer so that they can keep re-using the program. I've come up with a couple of ideas to prevent this, but I'm not sure how to implement them, or if Auto Hot Key even has the capability to do so.
Method 1:
I would write to the registry when the program is run. After it starts - it would check the event log to see if the date on the current system had been changed within the past 24 hours. If it had, it would create another registry entry, and the program would not be allowed to run ever again with that date. This would allow the customer to get a new passcode from us in a future date for future troubleshooting. My primary question here is this: can Auto Hot Key read from the Event Log in Windows, and search for a specific event ID (in Windows 7, a date and time change is event 4616, if I remember correctly)?
Method 2:
Simply use the network time protocol and check the current time with Google or another atomic clock, and only allow the program to run if the date matches that. The question here is: can Auto Hot Key use the NTP to check the time? I would prefer not to use this method as I don't want to have to connect to an outside network.
Thanks in advance for the advice.
I'm currently working on a program that I would be able to send to a customer with a single day's use. I've developed a formula based on the current date that returns a passcode, which would in turn be sent to the customer with the program (which will allow them access to a higher level on some specialized equipment for troubleshooting purposes). The next thing I'd like to do is add functionality to the program to prevent the customer from setting the date on their computer so that they can keep re-using the program. I've come up with a couple of ideas to prevent this, but I'm not sure how to implement them, or if Auto Hot Key even has the capability to do so.
Method 1:
I would write to the registry when the program is run. After it starts - it would check the event log to see if the date on the current system had been changed within the past 24 hours. If it had, it would create another registry entry, and the program would not be allowed to run ever again with that date. This would allow the customer to get a new passcode from us in a future date for future troubleshooting. My primary question here is this: can Auto Hot Key read from the Event Log in Windows, and search for a specific event ID (in Windows 7, a date and time change is event 4616, if I remember correctly)?
Method 2:
Simply use the network time protocol and check the current time with Google or another atomic clock, and only allow the program to run if the date matches that. The question here is: can Auto Hot Key use the NTP to check the time? I would prefer not to use this method as I don't want to have to connect to an outside network.
Thanks in advance for the advice.