Jump to content

run after 3 restarts


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...