bobheart Posted May 27, 2004 Share 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. Link to comment Share on other sites More sharing options...
Josbe Posted May 27, 2004 Share 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 Link to comment Share on other sites More sharing options...
bobheart Posted May 27, 2004 Author Share 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 ? Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share 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",) Link to comment Share on other sites More sharing options...
bobheart Posted May 27, 2004 Author Share Posted May 27, 2004 No I have a help.txt file that I want notepad to open . Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share 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 Link to comment Share on other sites More sharing options...
AutoChris Posted May 27, 2004 Share Posted May 27, 2004 Put in the full path to the text file. Link to comment Share on other sites More sharing options...
bobheart Posted May 27, 2004 Author Share 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 . Link to comment Share on other sites More sharing options...
brett Posted May 27, 2004 Share Posted May 27, 2004 couldn't u use @ScriptDir? -Brett Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share 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... Link to comment Share on other sites More sharing options...
brett Posted May 27, 2004 Share Posted May 27, 2004 post a few that dont work -Brett Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share 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 Link to comment Share on other sites More sharing options...
Valik Posted May 27, 2004 Share 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". Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share Posted May 27, 2004 yup you right Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share Posted May 27, 2004 (edited) next time valik quit swinging the 2x4 so hard.... Edited May 27, 2004 by beerman Link to comment Share on other sites More sharing options...
bobheart Posted May 27, 2004 Author Share Posted May 27, 2004 Ok so this will work Run("notepad.exe"&"c:\help.txt",@WindowsDir,@SW_MAXIMIZE) all give it a try now . Link to comment Share on other sites More sharing options...
bobheart Posted May 27, 2004 Author Share Posted May 27, 2004 I give up all just use a msg box for it . Link to comment Share on other sites More sharing options...
Somerset Posted May 27, 2004 Share 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... Link to comment Share on other sites More sharing options...
bobheart Posted May 27, 2004 Author Share Posted May 27, 2004 Thank you thank you , that worked .. i will save that code and lock it up in my safe .. 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