Jump to content
Sign in to follow this  

How to open a file otherthan '.exe' file

Recommended Posts


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)


While 1

$msg = GuiGetMsg()


Case $msg = $GUI_EVENT_CLOSE


Case $msg = $Button1

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

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





Can u suggest the script to open the file.

Share this post

Link to post
Share on other sites

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.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.