bobheart Posted May 27, 2004 Posted May 27, 2004 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.
Josbe Posted May 27, 2004 Posted May 27, 2004 (edited) Here your answer.The directory name is invalid.If the path is correct, try removing the "\" Edited May 27, 2004 by josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
bobheart Posted May 27, 2004 Author Posted May 27, 2004 --------------------------- 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 ?
Somerset Posted May 27, 2004 Posted May 27, 2004 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",)
bobheart Posted May 27, 2004 Author Posted May 27, 2004 No I have a help.txt file that I want notepad to open .
Somerset Posted May 27, 2004 Posted May 27, 2004 (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 May 27, 2004 by beerman
bobheart Posted May 27, 2004 Author Posted May 27, 2004 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 .
Somerset Posted May 27, 2004 Posted May 27, 2004 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...
Somerset Posted May 27, 2004 Posted May 27, 2004 (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 May 27, 2004 by beerman
Valik Posted May 27, 2004 Posted May 27, 2004 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".
Somerset Posted May 27, 2004 Posted May 27, 2004 (edited) next time valik quit swinging the 2x4 so hard.... Edited May 27, 2004 by beerman
bobheart Posted May 27, 2004 Author Posted May 27, 2004 Ok so this will work Run("notepad.exe"&"c:\help.txt",@WindowsDir,@SW_MAXIMIZE) all give it a try now .
Somerset Posted May 27, 2004 Posted May 27, 2004 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...
bobheart Posted May 27, 2004 Author Posted May 27, 2004 Thank you thank you , that worked .. i will save that code and lock it up in my safe ..
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