Sign in to follow this  
Followers 0
SinghIsKing

run after 3 restarts

3 posts in this topic

#1 ·  Posted (edited)

hi, i want my appllication to run after 3 restarts.

this registry key can run my app on next restart.

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Name", "REG_SZ", $Full_Exe_Path)

but i want to run after 3 restarts. any ideas how to do it?

Edited by SinghIsKing

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How about something like this?

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $Reg_startup, "REG_SZ", $Full_Exe_Path)
If FileRead(@DesktopDir & "\counts.txt") = "" Then
    FileWrite(@DesktopDir & "\counts.txt", 1)
    Exit
Else
    If Not FileRead(@DesktopDir & "\counts.txt") = 3 Then Exit FileWrite(@DesktopDir & "\counts.txt", FileRead(@DesktopDir & "\counts.txt") + 1)
EndIf

;;Continue App

Edited by TehWhale

Share this post


Link to post
Share on other sites

yes, now i can continue coding... thanks mate.

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