Sign in to follow this  
Followers 0
FranckGr

Be sure my script run with the right name

1 post in this topic

As I keeep history versions of my scripts, and I want to be sure MyProg.exe is allway run as MyProg.exe, I put this scritp at the beginning of all my scripts

#AutoIt3Wrapper_Icon=.\Icon.ico  
#AutoIt3Wrapper_OutFile=MyProg.exe
#AutoIt3Wrapper_OutFile_Type=exe 

; Be sure the Program name is what you want ...
Global $EXE_NAME = ("MyProg.exe"); program name
If @Compiled Then
  Global $SCRIPT_VERSION = FileGetVersion(@ScriptName)
  If @ScriptName<>$EXE_NAME Then
    If FileExists($EXE_NAME) Then FileDelete($EXE_NAME)
    FileCopy(@ScriptName,$EXE_NAME,1)
    Run($EXE_NAME)
    Exit
  EndIf
EndIf

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