clifox Posted April 16, 2007 Share Posted April 16, 2007 Hi all, I have a autoit executable script that runs as a process. The idea is that I don't my users to be able rename the executable as it is not going to be launched again with windows. How can this be done? Thanks in advance! Link to comment Share on other sites More sharing options...
MHz Posted April 16, 2007 Share Posted April 16, 2007 Check @Scriptname. Link to comment Share on other sites More sharing options...
iceberg Posted April 16, 2007 Share Posted April 16, 2007 hi, try @ScriptName mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
GEOSoft Posted April 16, 2007 Share Posted April 16, 2007 (edited) Hi all,I have a autoit executable script that runs as a process. The idea is that I don't my users to be able rename the executable as it is not going to be launched again with windows. How can this be done?Thanks in advance!Without actually writing the code for you, take a look atWinGetTitleIf WinExistsProcessListWork with those then post what you have come up with and we can look at refinements.EDIT: Add ProcessClose into the mix Edited April 16, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 I knew about this. But there is another executable that is working with the first one and how @scriptname is going to work the second. It's there and way to make it unrenameable? Thanks! Link to comment Share on other sites More sharing options...
MHz Posted April 16, 2007 Share Posted April 16, 2007 (edited) Err, 2nd process? Edit: Your script can check it's own name. Edited April 16, 2007 by MHz Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 Err, 2nd process?What do you mean by this? Link to comment Share on other sites More sharing options...
MHz Posted April 16, 2007 Share Posted April 16, 2007 What do you mean by this?Same, what 2nd process in #15 are you describing? Are we using 1 file as in 1 process? Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 Same, what 2nd process in #15 are you describing? Are we using 1 file as in 1 process?I will try to describe again: there are 2 autoit executable scripts that works like processes and from time to time checks for the existence of one another. Link to comment Share on other sites More sharing options...
MHz Posted April 16, 2007 Share Posted April 16, 2007 Why 2? Only need 1 using @scriptname? Link to comment Share on other sites More sharing options...
GEOSoft Posted April 16, 2007 Share Posted April 16, 2007 (edited) You could also take a look at writing a registry value on first run and then checking that value at the begining of the script. $MyVal = RegRead("HKLM\Whateverkey", "FirstRun") If $MyVal = 1 AND ProcessExists("Explorer.exe") Then Exit Else RegWrite("HKLM\Whateverkey","FirstRun","REG_SZ","1") EndIf Edited April 16, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 I want to thank you very much, you are very nice people and more very fast also! The 2 processes I was talking about they both doing a different job, but they need one another, so if the user chances one of them name and kills it then the second cannot do his job anymore. Link to comment Share on other sites More sharing options...
MHz Posted April 16, 2007 Share Posted April 16, 2007 Bye... Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 One of them is in charge of the GUI and the other is doing the real job Link to comment Share on other sites More sharing options...
GEOSoft Posted April 16, 2007 Share Posted April 16, 2007 I want to thank you very much, you are very nice people and more very fast also!The 2 processes I was talking about they both doing a different job, but they need one another, so if the user chances one of them name and kills it then the second cannot do his job anymore.OK now I understand what you are trying to do (I THINK!!). This may involve changing the name of your script back to what it should be, more than preventing a rename. You can not prevent a file from being renamed by the user but you certainly can force a rename back to the original file name.Let me give this some thought. In the meantime someone else may have the code at the ready. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 This is a good idea indeed GEOSoft to rename it back to original name. I will try it! Thanks Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 This is a good idea indeed GEOSoft to rename it back to original name. I will try it! Thanks Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 I have tried it, but the autoit remembers only the initial @scriptname, it does check it every time the variable is checked. So it will always return the initial name. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 16, 2007 Developers Share Posted April 16, 2007 I have tried it, but the autoit remembers only the initial @scriptname, it does check it every time the variable is checked. So it will always return the initial name.Now why would somebody want to rename the script ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
clifox Posted April 16, 2007 Author Share Posted April 16, 2007 The program runs for the whole time windows is running and a reason would be to stop it start with windows once it's name is changed. 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