Jump to content
Sign in to follow this  

Wrong FileOpenDialog directory after creating exe

Recommended Posts


I am using fileopendilog to pick a file from directory. Directory location is stored in a file, after reading file I am storing this location in a variable. And I am passing this variable to a function triggers FileOpenDialog. This works fine if I run the script directly from scite.

But once I create an executable it's picking up the last accessed directory location.

Any idea what might be going wrong.

Here is  sample code:

$SMEBrowseB = GUICtrlCreateButton("Browse", $BX, $IBY, $BW, $BH)


func _GetSMEBrowseB()
   $SMELoc = GetSMEPath("SME Location", $SMEDir, "SME (*.sme_exe;*.sme_proj)" )
Func GetSMEPath ($Title,$Dir,$Ext)
   MsgBox("","Dir",$Dir) ; Geting right location
   Local $Path=0
   Local $FilesList=""
   $Path = FileOpenDialog($Title, $Dir, $Ext,1 )
   return $Path

Share this post

Link to post
Share on other sites

FileChangeDir have a look at the WorkingDir.

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

@Workingdir is correctly set to the location where my executable resides.

Another observation is, issue only observed while using exe file; if I create a3x file it's picking-up the right start-up directory.

Share this post

Link to post
Share on other sites

I think it's maybe related to this?

Windows 7: If lpstrInitialDir has the same value as was passed the first time the application used an Open or Save As dialog box, the path most recently selected by the user is used as the initial directory.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...