Jump to content

Recommended Posts

Posted

I have one file(not .exe file) in c:\.I am using following script to search the file and store it in a variable.Now i want to click the file to open.

#include <Excel.au3>

#include <GUIConstants.au3>

$message = "Hold down Ctrl or Shift to choose multiple files."

$Form1 = GUICreate("Search for CFD_Test.rpt", 404, 195, 206, 126)

$Button1 = GUICtrlCreateButton("Choose CFD_Test.rpt File", 80, 70, 190, 30)

GUISetState(@SW_SHOW)

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $Button1

$var=FileOpenDialog($message, "Desktop", "All Files (*.rpt)", 1 + 4 )

MsgBox(4096,"","You chose " & $var)

sleep(2000)

WinClose($Form1)

EndSelect

WEnd

Can u suggest the script to open the file.

Posted

Did you try ShellExecute ?

I tried Shell Execute.but,its look like 'Run' to execute otherthan '.exe' file.

But initially i opened one main window with in that i have to open a file.using shellexecute it opens a new window. i want to open the file within the same window.

can u share the script for this scenario.

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
  • Recently Browsing   0 members

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