Jump to content
Sign in to follow this  
Tukata

FileOpen and Run specific file

Recommended Posts

Tukata

Hi,

I want to open a specific (file.pte) file in "PicturesToExe" program (apr.exe).

I wrote:

$var = FileOpenDialog($message, ".Fath", "PTE (*.pte)", 1 )
Run("C...\apr.exe", "", $var)

When the OpenFile dialog open I select file.pte and the program do open (apr.exe). but not the selected file (file.pte).

How can I do this if it is possible ?

Thank you

Tuk

Edited by Tukata

Share this post


Link to post
Share on other sites
SmOke_N

Hi,

I want to open a specific (file.pte) file in "PicturesToExe" program (apr.exe).

I wrote:

$var = FileOpenDialog($message, ".Fath", "PTE (*.pte)", 1 )
Run("C...\apr.exe", "", $var)

When the OpenFile dialog open I select file.pte and the program (apr.exe) do open but without the selected file.

How can I do this if it is possible ?

Thank you

Tuk

Latest Beta +

$var = FileOpenDialog($message, ".Fath", "PTE (*.pte)", 1 )
ShellExecute($var)oÝ÷ ØêÚºÚ"µÍÌÍÝH[SÜ[X[ÙÊ   ÌÍÛYÜØYÙK ][ÝË] ][ÝË  ][ÝÔH

JI][ÝËH
B[ÛÛÜXÈ [È ÌÎNÈØÈ ][ÝÉÌÎNÈ   [È ÌÍÝ  [È ÌÎNÉ][ÝÉÌÎNË    ÌÎNÉÌÎNËÕ×ÒQJ

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Tukata

SmOke_N

Thank you. The second code work fine but the first one no (ShellExecute($var)).

I installed latest version and to my surprise AVG told me there is a virus in SciTE. The new compiler does not work and it gives error that can not find "stub" file (?) Any suggestion what to do ?

Thank you

Tuk

Edited by Tukata

Share this post


Link to post
Share on other sites
SmOke_N

SmOke_N

Thank you. The second code work fine but the first one no (ShellExecute($var)).

I installed latest version and yo my surprise AVG told me there is a virus in SciTE. The new compiler does not work and it gives error that can not find "stub" file (?) Any suggestion what to do ?

Thank you

Tuk

2 suggestions.

1. Get rid of AVG

2. Update your AVG, this issue was taken care of 2 days ago I believe.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Tukata

Thank you. I updated AVG and re-installed Autoit. This time no virus found.

But the ShellExecute($var) still gives an error.

My full script is:

#include <file.au3>
$message = "Please select PTE file:"
$var = FileOpenDialog($message, "C:\Program Files\PicturesToExe\", "PTE (*.pte)", 1 )

If @error Then
    MsgBox(4096,"","No file was chosen. Bye !")
Exit
Else
    $var = StringReplace($var, "|", @CRLF)
Dim $szDrive, $szDir, $szFName, $szExt
$TestPath = _PathSplit($var, $szDrive, $szDir, $szFName, $szExt)
EndIf

ShellExecute($var)

Thank you

Tuk

Share this post


Link to post
Share on other sites
SmOke_N

Thank you. I updated AVG and re-installed Autoit. This time no virus found.

But the ShellExecute($var) still gives an error.

My full script is:

#include <file.au3>
$message = "Please select PTE file:"
$var = FileOpenDialog($message, "C:\Program Files\PicturesToExe\", "PTE (*.pte)", 1 )

If @error Then
    MsgBox(4096,"","No file was chosen. Bye !")
Exit
Else
    $var = StringReplace($var, "|", @CRLF)
Dim $szDrive, $szDir, $szFName, $szExt
$TestPath = _PathSplit($var, $szDrive, $szDir, $szFName, $szExt)
EndIf

ShellExecute($var)

Thank you

Tuk

Did you do a MsgBox(0, '', $var) to see what your issue is? Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Tukata

The $var gives the full path to the selected pte file.

But I don't know what it is suppose to give ?

Am looking also in the Help to read about "ShellExecute" but find nothing.

Thank you

Tuk

Share this post


Link to post
Share on other sites
SmOke_N

The $var gives the full path to the selected pte file.

But I don't know what it is suppose to give ?

Am looking also in the Help to read about "ShellExecute" but find nothing.

Thank you

Tuk

Make sure you are running beta 3.2.1.8 or later, then to find it in the help file, with SciTe open do: Alt+F1, that's the beta help file. When running Beta scripts, you must also use Alt+F5 instead of just F5.... enjoy.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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.