devi Posted August 11, 2011 Share Posted August 11, 2011 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. Link to comment Share on other sites More sharing options...
wakillon Posted August 11, 2011 Share Posted August 11, 2011 Did you try ShellExecute ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
devi Posted August 11, 2011 Author Share Posted August 11, 2011 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now