Sign in to follow this  
Followers 0
Nukex1

one time lock

4 posts in this topic

#1 ·  Posted (edited)

my program will work and work until you restart your computer

I want it to be only used once

unless they know autoit ofc muttley if they know autoit they deserve to use it again

so something like this I hope you get it :)

if lock = 1 then it can be used

and when the func get used it turn lock = 0

how do I do that?

also I dont want the program to stop working while its turned on just because it turns the lock = 0

Edited by Nukex1

Share this post


Link to post
Share on other sites



this is done without having to install anything right?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

this is done without having to install anything right?

Install? You can use the registry functions in autoit to create a new entry in the registry (ex. "lock" with value 1) and then RegRead() that entry at the start of the program, exiting if equal to 1.

Example:

$LockStatus = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Lockout", "Lock")

If $LockStatus = 1 Then
    MsgBox(0, "Error", "This program cannot be run again", 2)
    Exit
Else
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Lockout", "Lock", "REG_DWORD", 1)
EndIf

;Actual Program Here
MsgBox(0, "Testing", "Congrats this is your first time running this program.")

Edited script for clarity.

Edited by dandymcgee

- Dan [Website]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0