How to require user to activate my program?

153 Views Asked by At

I was wondering...

I have a program, and I want to charge money for it.

it runs on Windows, and is written mostly in VB and Batch-files...

how can I force the user to buy a product key for it, and activate it to use the Paid Version?

Thanks in advance!

~ @Cascading-style

1

There are 1 best solutions below

0
On

This just a little example showing you that you can limit the number of execution of your program , so if the maximum of number of execution is reached the program will Auto delete by him self

@echo off
Setlocal enabledelayedexpansion
Title Count the number of times my BATCH file is run
Mode Con Cols=70 lines=7 & color 0E
Set /a MaxExecution=3
set /a count=1
set "FileCount=%tmp%\%~n0.dll"
If Not exist "%FileCount%" (
    echo !count! > "%FileCount%"
) else (
    For /F "delims= " %%a in ('Type "%FileCount%"') Do (
        set /a count=!count! + %%a
        echo !count! > "%FileCount%"
    )
)
echo.
echo             This Program is running for "!count!" time(s)
Call :SelfDelete
pause>nul & Exit /b
::**************************************************************
:SelfDelete
echo.
If !count! GTR !MaxExecution! (
    Color 0C
    echo The maximum execution of this "%~nx0" is set to "!MaxExecution!"
    echo and it is reached & Timeout /T 5 /Nobreak>nul & Del %~f0
    ) else (
    echo         The counting is "!count!" and the max is set to "!MaxExecution!"
)
Goto :EOF
::**************************************************************