Jump to content

How to prevent renaming of autoit exe scripts?


Recommended Posts

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

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 at

WinGetTitle

If WinExists

ProcessList

Work with those then post what you have come up with and we can look at refinements.

EDIT: Add ProcessClose into the mix

Edited 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

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

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 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

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

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

  • Developers

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

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...