Sign in to follow this  
Followers 0
bobheart

this right ?Run("Notepad.exe", "\help.txt", @SW_MA

19 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Here your answer.

The directory name is invalid.

If the path is correct, try removing the "\"

Edited by josbe

Share this post


Link to post
Share on other sites

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

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 ?

Share this post


Link to post
Share on other sites

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",)

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

No I have a help.txt file that I want notepad to open .

Share this post


Link to post
Share on other sites

#6 ·  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

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

Put in the full path to the text file.

Share this post


Link to post
Share on other sites

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 .

Share this post


Link to post
Share on other sites

couldn't u use @ScriptDir?


-Brett

Share this post


Link to post
Share on other sites

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...


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

post a few that dont work


-Brett

Share this post


Link to post
Share on other sites

#12 ·  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

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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".

Share this post


Link to post
Share on other sites

yup you right

:D


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

next time valik quit swinging the 2x4 so hard.... :D

Edited by beerman

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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

all give it a try now .

Share this post


Link to post
Share on other sites

I give up all just use a msg box for it .

Share this post


Link to post
Share on other sites

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...


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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

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  
Followers 0