Jump to content

open text files with notepad


Ace08
 Share

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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 8 years later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...