Jump to content

Recommended Posts

Posted

Hi,

I'm trying to:

-Select a file in a folder (to store it to an ini file)

-Write the file on an ini

-Copy files to the folder selected by the user

instead of using FileOpenDialog then FileSelectFolder, I was wondering if it was possible to do the whole thing only with FileOpenDialog spliting the value returned in 2 variables. I got something like that for the first part (select a file and store it to an ini file)

Local $message = "Select your executable"
                        Local $pathk = FileOpenDialog($message, "C:" & "", "Select the executable you want to terminate (*.exe)", 1 + 4)

                        Local $path = "None"
;ici je dois copier les fichiers

                        $split = StringSplit($pathk, "\")
                        $tokill = $split[$split[0]]



                        If @error Then
                        MsgBox(4096, "", "No Executable chosen")
                        Else



                        MsgBox(4096, "", $pathk & " Will be terminated " & @LF & @LF & "Press OK to EXIT ")
                        IniWrite(@ScriptDir & "\path.ini", "Torun", "path", $path)
                        IniWrite(@ScriptDir & "\path.ini", "Tokill", "pathk", $tokill)
                        EndIf

As you can see I manage to split the value returned by FileOpenDialog to have only the exe but as a noob I can't manage to get the path to copy the files I need to the same path.

Any idea? ^^

Posted

Have a look at _PathSplit it will split a full path and file name out into an array of useful parts.

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

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
×
×
  • Create New...