Tracking days in time-limited shareware

Posted on 1997-06-07
Last Modified: 2013-11-14
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.
Question by:pixie060797
  • 2
  • 2
  • 2
  • +2

Expert Comment

ID: 1426962
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.

Expert Comment

ID: 1426963
can you give me a reason why thats wrong?! Thats exactly what I use to protect my programs, and it works.

Expert Comment

ID: 1426964
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.

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.


Expert Comment

ID: 1426965
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  


Accepted Solution

PedroMVGomes earned 100 total points
ID: 1426966
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.

Author Comment

ID: 1426967
Edited text of question

Expert Comment

ID: 1426968
Please post a link to an example program, a small one, that I can download and try to check how it works.

Author Comment

ID: 1426969
SpiderPad does that, it's about 2.5MB, but you'll enjoy this powerful HTML editor. It's located at:

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protecting vb6 & .Net code Obfuscation 18 121
Windows Update 22 175
IF ELSE Statement in Excel Macro VBA 16 62
When to install VMware Tools on Domain Controller? 9 47
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now