Tracking days in time-limited shareware

I want to know how to make a counter that increases each day.

It should be a little more complicated than adding/changing a file in the program's path or \windows and \windows\system path or checking/changing a file's date...

I CRC-checked all the files in the HD before and after, and didn't see a change. Take, for example, SpiderPad, Netscape Cache Explorer or InstallShield. And there are dozens.


1. No change in checksum/CRC was detected (before-after tests)
2. No comparing of some hidden registry value or something to the system's date. Else - you'd just set the date to few days before.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Put a value in the system registry (using savesetting command in vb5, and then getsetting to restore it) telling it the date the first time the program is run. Then, each time the program is run, compare the value in the registry, to that of the date of the system (by using the commands day(now), month(now), and year(now)). If you need help on any of these commands, look up savesetting, getsetting, day, month, and year.
can you give me a reason why thats wrong?! Thats exactly what I use to protect my programs, and it works.
Storing it in the registry is a good idea. The only place to save something permanently is on the hard disk. If you don't want to put it in a normal file (or ini-file or whatever), you have to use the registry.

Don't use savesetting, though, use some other key name, something that nobody would think belongs to your program.

And don't save the count directly, do some mathematical translation on it before, or it will be easy to "search and replace".

Finally, don't count on it being the perfect method, whichever one you choose. For example, if running under Windows NT, all registry and file accesses might be logged. No big problem to find out what you're doing. And strange actions not expected by an installation program might even be perceived as a trojan horse or virus.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

If you use system date all someone has to do is set the date back on the computer one year and tada!  This program is good for one more year.   I have created an OCX file that will stop this all from happening.   It's called Shareware Lock and I will be releasing it soon..   There is no way to hack it or cheat it.  On the first of July it expires and sooner if I want with a touch of a key.. you can download my shareware program and tell me what you think of the Shareware Lock.  The login is "sw1" (case sensitive).  If you like it and want more info about it email me at  

Normaly i protect my files by stroring in the end off them the Data.

You can after compiling your project make a simple one, witch will open the exe file and append in it the initial date. Then your project must also have a routine that checks the end of the file for the date and compares it with the current date.

Note wen first writing the date leave some empty bytes at the end of the file, i.e. don't write the date exact end of the file, write it at a possition 5 or 6 bytes after.

Particulary importat is that you store the date in some sorte of code, and you must know if it is missing, to prevent hacking.

This is a simple way, but it works.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pixie060797Author Commented:
Edited text of question
Please post a link to an example program, a small one, that I can download and try to check how it works.
pixie060797Author Commented:
SpiderPad does that, it's about 2.5MB, but you'll enjoy this powerful HTML editor. It's located at:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.