-1

I'm trying to write a script which allows the tool to run only 5 times. If the user tries to run the tool a 6th time, the tool should throw an error as Expired.

Can anyone please help me in this?

Terry
  • 6,160
  • 17
  • 16
Divya
  • 1

1 Answers1

1

Create a registry key and control it that way. HKCU\Software\YourApp\timesrun or something like that... Increment it by one everytime the "tool" runs, and throw an exception when it exceeds 5 times.

-Paul Horan-

NoazDad
  • 608
  • 3
  • 9