Jump to content

Recommended Posts

Posted

Won't work gives error can't find it ?

Run("Notepad.exe", "\help.txt", @SW_MAXIMIZE)

help.txt is in the same folder as the progam /au3

---------------------------

AutoIt Error

---------------------------

Line 123  (File "E:\Programs\AutoIt3\Examples\English\5_24\new small notes\small note8.au3"):

Run("Notepad.exe", "\help.txt", @SW_MAXIMIZE)

Error: Unable to execute the external program.

The directory name is invalid.

Posted

---------------------------

AutoIt Error

---------------------------

Line 123 (File "E:\Programs\AutoIt3\Examples\English\5_24\new small notes\small note8.au3"):

Run("Notepad.exe", "help.txt", @SW_MAXIMIZE)

Error: Unable to execute the external program.

The directory name is invalid.

```````````````````````````

What now ?

Posted

if you think the help file is a text file it isn't

it is a chm file.... notepad doesn't handle chm files.

Run(@WindowsDir&"\hh.exe "& @ProgramFilesDir & "\AutoIt3\AutoIt.chm",)
Posted (edited)

oh ok, so here.. now pay attention

Run("notepad.exe"& @ProgramFilesDir & "\AutoIt3\help.txt",@WindowsDir,@SW_MAXIMIZE)

Run ( "filename" [, "workingdir" [, flag]] )

the file that you wish to open with notepad.exe has to follow notepad.exe with the path name and file for notepad to open. this all has to be done before the working directory of notepad....

if any questions tell me the path to the text file and i will give you a working example ok...

Edited by beerman
Posted

But I have no idea where they would install this if i gave it to someone would I . so I need it to open from the folder that main exe is in as the help.txt would be in the same folder it is in .

Posted

you know i used 5 variations with different scriptdir macros still won't work for me... hmmmm let me try to just port it out to either a bat file or au3 with scriptdir and notpad path then try to run it...

Posted (edited)

did you know moving the help.txt to even c:\ and trying this won't even work Run("notepad.exe"&"c:\help.txt",@WindowsDir,@SW_MAXIMIZE) and oh before you even ask i tried all this with the run dialog first and it runs just fine from there

Edited by beerman
Posted

Of course it won't. There isn't a space between notepad.exe and the path. It's being resolved as: "notepad.exec:\help.txt".

Posted

Ok so this will work Run("notepad.exe"&"c:\help.txt",@WindowsDir,@SW_MAXIMIZE)

all give it a try now .

Posted

hey no valik was correct

give me a second

Run("notepad.exe "&@Scriptdir&"\help.txt",@WindowsDir,@SW_MAXIMIZE)

remmber to have the help.txt in the same folder...

Posted

Thank you thank you , that worked .. i will save that code and lock it up in my safe ..

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
×
×
  • Create New...