Jump to content
Sign in to follow this  
Ace08

open text files with notepad

Recommended Posts

hi guys how can i open a text file in a notepad?

so far i've tried the following and none worked....

$sTextFile = "C:\script\test.text"
Run($sTextFile); does'nt open the file no error either
Run("notepad.exe" $sTextFile); same with this
Run("notepad.exe" & $sTextFile)
Run("notepad.exe", $sTextFile)

Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites

hi guys how can i open a text file in a notepad?

so far i've tried the following and none worked....

$sTextFile = "C:\script\test.text"
Run($sTextFile); does'nt open the file no error either
Run("notepad.exe" $sTextFile); same with this
Run("notepad.exe" & $sTextFile)
Run("notepad.exe", $sTextFile)

you forget the space after notepad ! Posted Image

Try Run ( "notepad.exe " & $sTextFile, @WindowsDir, @SW_MAXIMIZE )


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
;) thanks wakillon... so the cause of my 2 hrs frustration was due to a missing space :) now thats one thing i definitely need to remember.

Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites

;) thanks wakillon... so the cause of my 2 hrs frustration was due to a missing space :) now thats one thing i definitely need to remember.

for this error type i use a simple method :

$_Run = "notepad.exe" & $sTextFile
ConsoleWrite ( "$_Run : " & $_Run & @Crlf ) 
Run ( $_Run, @WindowsDir, @SW_MAXIMIZE )

With ConsoleWrite you'll see that space is missing ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
2 minutes ago, sebastiian said:

¿Y como quedaría el código?

$sTextFile = "C:\hola_mundo.txt"
Run ( "notepad.exe " & $sTextFile, @WindowsDir, @SW_MAXIMIZE )

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...