bobheart Posted August 19, 2004 Share Posted August 19, 2004 Not sure if someone has this so maybe all ask . I need some code that will run a exe file three times then delete the exe . Maybe write a ini file so it know how many times it has been used if ini file is delete it deletes the exe right then . exe file what every you want to name it i can change mine to it . Thanks if you have this or can code it for me . Link to comment Share on other sites More sharing options...
nobby Posted August 19, 2004 Share Posted August 19, 2004 If you need to run the exe 3 times in a row... Runwait("your.exe") Runwait("your.exe") Runwait("your.exe") filedelete("your.exe") That should do the trick. CheersNobby Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 If you need to run the exe 3 times in a row... Runwait("your.exe") Runwait("your.exe") Runwait("your.exe") filedelete("your.exe") That should do the trick. <{POST_SNAPBACK}>Well it may run on one day and maybe some other day again and so on so that would not work I don't think . Link to comment Share on other sites More sharing options...
Josbe Posted August 19, 2004 Share Posted August 19, 2004 Some related posts:One...Another... AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 I didn't se eanything on how to let it run x many times then delete . just password it . Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 Or it could be just A exe that runs three times then deletes it self that would work too . as I could wrap it with a program I have so all they would see it that exe file . Link to comment Share on other sites More sharing options...
nobby Posted August 19, 2004 Share Posted August 19, 2004 Try this, using the registry RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count") If @error = 1 RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count" ,"REG_DWORD" , "0" ) endif if RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count")= 0 then RunWait("your.exe") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count" ,"REG_DWORD" , "1" ) exit elseif RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count")= 1 then RunWait("your.exe") RegWrite ( "HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count" ,"REG_DWORD" , "2" ) exit elseif RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\YourKey", "count")= 2 then RunWait("your.exe") RegDelete ( "HKEY_LOCAL_MACHINE\SOFTWARE\YourKey") FileDelete("your.exe") endif Hope this is what you are after CheersNobby Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 I will give it a try right now and get back to you when I get it running . thank you for the help . Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 --------------------------- AutoIt Error --------------------------- Line 0: If @error = 1 Error: "If" statements must have a "Then" keyword. Got that first run ? Link to comment Share on other sites More sharing options...
nobby Posted August 19, 2004 Share Posted August 19, 2004 oooops just add the "then" at the end of "If @error = 1" . I corrected it locally but forgot to include in the post. Cheers CheersNobby Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 Thanks nobby .. that works great .. I had just added it to there when I saw you posted too. lol Link to comment Share on other sites More sharing options...
flyingboz Posted August 19, 2004 Share Posted August 19, 2004 If you're trying to ensure someone pays you for your code, you may want to do something slightly more elegant than using an integer counter in the registry or an ini file. There's nothing like trying to outsmart the guy who wants $$$ to try to get people poking around defeating software protection. I would suggest when you build your exe (using all the nodecompile or password protection options) that you incorporate, in lieu of the integer counter, three unrelated random strings. Naming the keys something innocent helps too. Then use a case or if/then/else structure to determine if one of the three passwords is present. This will stop 70% of the people who dare muck in the registry. This is still defeatable by someone who makes a snapshot of the registry and diffs/stores a working value ---- then you're talking time bombs and how to you ensure that they haven't mucked w/ the system clock, etc. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 Ya I just was going to trying this and see how it works . if you feel like doing some code like you said I will try it out thats for sure . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now