Jump to content

Be sure my script run with the right name


FranckGr
 Share

Recommended Posts

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