Jump to content
Sign in to follow this  

Can't save filename and path to ini

Recommended Posts


I've searched the forums about this but didn't find anything like this.

I'm creating a config app for another app I've made and here's the code that's been messing

Case $btn_Browse1
    $Process0Path = FileOpenDialog( "Open Process" , @WorkingDir & "\" , "Process (*.exe)", 1 )
    GUICtrlSetData( $inp_Process0 , StringRegExpReplace( $Process0Path , '^.*\\' , '' ) )

When I press the button $btn_Browse1 a open file dialog shows. Whit that you can only open .exe files to get their filename and path.

I then split the filename from the path and store it in another variable and shows them in the program.

All working fine so far. But here's the problem. When trying to save $Process0Path and $inp_Process0 to an .ini file nothing gets saved, UNLESS the choosen .exe is in the same folder as this app...

Here's the code for saving. Don't think anything is wrong here though as I can successfully save other variables to the same .ini file.

IniWrite( @WorkingDir & "\Config.ini" , "ProcessName" , "Process0" , GUICtrlRead( $inp_Process0 ) )
IniWrite( @WorkingDir & "\Config.ini" , "ProcessPath" , "Process0" , $Process0Path )

An ideas of what's wrong?

Edited by CZorg

Share this post

Link to post
Share on other sites

The FilopenDialog changes the WorkingDir the ini is saved in the wrong folder. Try using @scripdir instead.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post

Link to post
Share on other sites

From the help file under FileOpenDialog():

@WorkingDir is changed on successful return.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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