Sign in to follow this  
Followers 0
onestcoder

Launch text file in Notepad

3 posts in this topic

What I want to do is when a user clicks to read my Read Me file from my Gui it opens the readme.txt file in Notepad.exe

In the help files I see this:

Which is the first step to understanding how to do it.

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

I have also read this post:

Launching a pdf file from a script, Launching a pdf file from a script

http://www.autoitscript.com/forum/index.ph...hl=@SW_MAXIMIZE

Which shows me

Run("explorer.exe " & @ScriptDir & "\Documentation\Help.pdf", "", @SW_MAXIMIZE)

Here is what I have mod it to

Run("Notepad.exe " & @ScriptDir & "\include\readme.txt", "", @SW_MAXIMIZE)

But its not working for me. Is there something I'm missing???


Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites



works for me.... Sometimes you need extra quotes when the file path contains spaces, but it works either way for me.

$path = @ScriptDir & "\include\readme.txt"

;Debug
MsgBox(0,"Path", $path)
If Not FileExists($path) Then MsgBox(0,"error","File not found")
    
;Try one
Run("Notepad.exe " & $path, "", @SW_MAXIMIZE)

;Second try
Run("Notepad.exe " & """" & $path & """", "", @SW_MAXIMIZE)

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

i have found when the path has spaces...;

$Path = FileGetShortName( ACTUAL PATH )

Run("Prog.exe " & $path, "", @SW_MAXIMIZE)

works everytime

8)


NEWHeader1.png

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