Jump to content
Sign in to follow this  

.ini file remember/find

Recommended Posts


I have a question and I cant find the awnser.

Here you see a part of my script, you must select a file and then a part of the path will be replaced by: SroTool.ini

And then the SroTool.ini file will be saved in the map where you have selected the file: hook.exe from.

Normally I put the file here: "C:\Windows\config.ini" but not everyone have this map.

So my problem is:

If I open the tool at another time how must I let the script know where the SroTool.ini file is?

If there isn't a solution for it, maby someone can reply another good solution to solve the problem in some kind of way?

Here is a part of my working script:

Func selecthookButton()
      $bericht = "Select the hook.exe file"
      $pad = FileOpenDialog($bericht, @WindowsDir & "\", "Hook (*.exe;)", 1 + 4 )
      $configfile = StringReplace($pad, "Hook.exe", "SroTool.ini")
      IniWrite($configfile, "Filepaths", "Hook.exe", $pad)
      GUICtrlSetData($padhook, $pad)



Edited by Jeanpierre92

Share this post

Link to post
Share on other sites

You can use relative paths for the ini file, or store it in application directory (@AppDataDir) where it's supposed to go.

If you want to put the ini in the same directory as in, then don't specify a path at all: IniWrite("SroTool.ini", ... etc

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.