Jump to content

How do i display a file in an input box after browsing?


Recommended Posts

How do I display a file after browsing and selecting it.

inputbox variable is

$txtBatchPath = GUICtrlCreateInput("", 105, 117, 129, 19)

here is the browse code:

Case $cmdSelectBatchPath
     ;load batch
     BatchPath()

and the function"

func BatchPath()
    $batchPath = FileOpenDialog("", "C:\", "Batch (*.bat)")
EndFunc
Edited by vladedoty
Link to comment
Share on other sites

Your request is not quiet clear. Set filepath in the input control (option 1), or display the file content itself (option 2 is one way).

func BatchPath()
    $batchPath = FileOpenDialog("", "C:\", "Batch (*.bat)")
    If not @error Then
        GUICtrlSetData($txtBatchPath,$batchPath) ; Option 1
        ShellExecute($batchPath,'','','edit') ; Option 2
    endif
EndFunc
Link to comment
Share on other sites

Your request is not quiet clear. Set filepath in the input control (option 1), or display the file content itself (option 2 is one way).

func BatchPath()
    $batchPath = FileOpenDialog("", "C:\", "Batch (*.bat)")
    If not @error Then
        GUICtrlSetData($txtBatchPath,$batchPath) ; Option 1
        ShellExecute($batchPath,'','','edit') ; Option 2
    endif
EndFunc

Thanks alot!! Option 1 is what I was looking for.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...