Camille_Feuvrais Posted January 26, 2023 Share Posted January 26, 2023 Hello, I have a problem using Auto IT. I use Auto IT to make monitoring screens. Then I start my scripts using Windows Task Scheduler To easily modify my scripts, I tried to put my variables in another file. So even if the script is complied (in .exe) I can still change some behavior. I have this line in my auto it file : #include "C:\temp\AutoIt\ConfigVariablesFile.au3" This Config File is updated automatically after every change I make in a network share. But the problem is the following : As I read here "https://www.autoitscript.com/autoit3/docs/intro/compiler.htm", the #includes are tokenised, compressed and encrypted so we don't need them after compiled the file in .exe. So after I compiled my script, it will not take the data in the config file anymore. I need my script to still do it. Do you have an idea ? Sorry for my awfull english and thank you for reading my post 🙏 Link to comment Share on other sites More sharing options...
Developers Solution Jos Posted January 26, 2023 Developers Solution Share Posted January 26, 2023 Use an INI file and read the info from it when you need to be able to update config variables. #include is for static code. Jos Camille_Feuvrais 1 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...
SOLVE-SMART Posted January 26, 2023 Share Posted January 26, 2023 Hi @Camille_Feuvrais, as far as I understand you correct, you want to parameterize your program execution, am I right? I mean, you store values of variables in a separate *.au3 file. When you compile your script, this *.au3 file is already included in the executable and will not be read again. That's your problem, I think. There are multiple ways/solutions to handle your requirement. One easy way could be, depending on the amount of your variables, to use a simple *.ini file. In this file you store your values of your variables and read it within the runtime of your program. So you can change the *.ini file content every time, like you described by a network share, also in script mode or as compiled program 👍 . Best regards Sven Camille_Feuvrais 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted January 26, 2023 Share Posted January 26, 2023 Oh, now I saw your post @Jos 😅 . Same idea, nice! Best regardsSven Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Camille_Feuvrais Posted January 26, 2023 Author Share Posted January 26, 2023 Hi, Thanks for your answers, After few research, i figured out how to do it using an .ini file. Have a great afternoon 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