Sign in to follow this  
Followers 0
Akshay07

What is wrong in this simple "OpenFile" instruction?

6 posts in this topic

Hi all,

I looked at the help (that's how I found the instruction) but the text file will not open!

FileOpen("Results.txt", 2)

The script is located in the same folder than the txt file.

I also tried (with the script in a different folder)

FileOpen("C:\test\Results.txt", 2)

But it is not working

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It will open fine to be able to read the records with FileRead(), but you probably want to run the application that normally opens the file.

Look at ShellExecute()

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It will open fine to be able to read the records with FileRead(), but you probably want to run the application that normally opens the file.

Look at ShellExecute()

Jos

Thanks, I will give it a try.

Edit: it works!

Is there also a way to force a .txt file to be opened with notepad in case the user has another text editor?

Edited by Akshay07

Share this post


Link to post
Share on other sites

It will open fine to be able to read the records with FileRead(), but you probably want to run the application that normally opens the file.

Look at ShellExecute()

Jos

How did you figure that out? ;)

That's brilliant.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Is there also a way to force a .txt file to be opened with notepad in case the user has another text editor?

Run("notepad.exe textfile.txt")

Share this post


Link to post
Share on other sites

Thanks!!!

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