Sign in to follow this  
Followers 0
Pasukun

Open file directly

5 posts in this topic

#1 ·  Posted (edited)

I understand how to open a program(for example notepad) by using the script below.

Run("Notepad.exe")

But, how can I load and open a .txt file directly other than just opening the empty notepad?

Thanks in advance. :(

Edited by Pasukun

Share this post


Link to post
Share on other sites



I understand how to open a program(for example notepad) by using the script below.

Run("Notepad.exe")

But, how can I load and open a .txt file directly other than just opening the empty notepad?

Thanks in advance. :(

<{POST_SNAPBACK}>

Search Scripts and Scrapts for a program called _Run(). It is by Ezzetabi.

Also you might want to look into the helpfile about @CompSpec. There is a windows function called start that you can use in conjuction with that to open it.

You could also open window's run command and tell it what to run and the file to run with it. (Little sloppy)

Also check this post for more ideas... http://www.autoitscript.com/forum/index.php?showtopic=11288

Just as a note you may want to consider running a search on the forums before posting such a question. Sometimes people will be a bit rude as you show no real interest in learning for yourself and that is what we are all about here.

Hope I have been of service,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Great! Thanks for the tip. :(

And for my ignorance.

I am sorry if I caused you an annoyance.

I didn't mean to display myself as an ignorant questioner.., but please do keep in mind that I am very new at the programming and not so resourceful in this field. (not to mention that I am a slow learner).

I am just now beginning to see all the possiblities with this program and just eager to learn anything that I can with it.

However, unlike my ego. I have been making a very slow progresses.., and due to my lack of knowledge.. I am constantly facing a problem with even the most simple scripts...

Most of the times, I can find my solution by looking through the help file and/or reviewing other's script, but some issues I just can not find the right answer no matter how hard I look.. as if no one ever asks such beginner's questions like I do.

Please believe me when I say that I don't mean to take this support forum as a granted or waste other people's precious time with my questions.

If you felt that way.. again I am sorry.

Share this post


Link to post
Share on other sites

or just use:

Run('Notepad.exe "nameoftextfile.txt" ')

note the use of single and double quotes.

You can also use this to run most other windows programs, although some may need paths.

Run('c:\temp\program.exe "c:\path\nameoffile.txt" ',"c:\path")

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Great! Thanks for the tip. :(

And for my ignorance.

I am sorry if I caused you an annoyance.

I didn't mean to display myself as an ignorant questioner.., but please do keep in mind that I am very new at the programming and not so resourceful in this field.  (not to mention that I am a slow learner).

I am just now beginning to see all the possiblities with this program and just eager to learn anything that I can with it.

However, unlike my ego. I have been making a very slow progresses.., and due to my lack of knowledge.. I am constantly facing a problem with even the most simple scripts...

Most of the times, I can find my solution by looking through the help file and/or reviewing other's script,  but some issues I just can not find the right answer no matter how hard I look.. as if no one ever asks such beginner's questions like I do.

Please believe me when I say that I don't mean to take this support forum as a granted or waste other people's precious time with my questions.

If you felt that way.. again I am sorry.

<{POST_SNAPBACK}>

I surely didnt mean that you have annoyed me in anyway or that you question was at all stupid. I believe there isnt really a stupid question... so long as you have exhausted all means available to find the answer yourself.

I didnt take anything you said wrong, and I understand being a beginner as I still consider myself a beginner compared to some here.

I am glad to have been of some service.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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