Jump to content
Sign in to follow this  
clifox

How to prevent renaming of autoit exe scripts?

Recommended Posts

clifox

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!

Share this post


Link to post
Share on other sites
MHz

Check @Scriptname.

Share this post


Link to post
Share on other sites
iceberg

hi,

try @ScriptName


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites
GEOSoft

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

Share this post


Link to post
Share on other sites
clifox

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!

Share this post


Link to post
Share on other sites
MHz

Err, 2nd process?

Edit:

Your script can check it's own name.

Edited by MHz

Share this post


Link to post
Share on other sites
clifox

Err, 2nd process?

What do you mean by this?

Share this post


Link to post
Share on other sites
MHz

What do you mean by this?

Same, what 2nd process in #15 are you describing? Are we using 1 file as in 1 process?

Share this post


Link to post
Share on other sites
clifox

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.

Share this post


Link to post
Share on other sites
MHz

Why 2? Only need 1 using @scriptname? :shocked:

Share this post


Link to post
Share on other sites
GEOSoft

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

Share this post


Link to post
Share on other sites
clifox

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.

Share this post


Link to post
Share on other sites
MHz

Bye...

Share this post


Link to post
Share on other sites
clifox

One of them is in charge of the GUI and the other is doing the real job

Share this post


Link to post
Share on other sites
GEOSoft

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

Share this post


Link to post
Share on other sites
clifox

This is a good idea indeed GEOSoft to rename it back to original name. I will try it!

Thanks

Share this post


Link to post
Share on other sites
clifox

This is a good idea indeed GEOSoft to rename it back to original name. I will try it!

Thanks

Share this post


Link to post
Share on other sites
clifox

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.

Share this post


Link to post
Share on other sites
Jos

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 ?

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
clifox

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.

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  

×