Ace08 Posted September 28, 2010 Share Posted September 28, 2010 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 More sharing options...
wakillon Posted September 28, 2010 Share Posted September 28, 2010 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 ! Try Run ( "notepad.exe " & $sTextFile, @WindowsDir, @SW_MAXIMIZE ) sulfur 1 AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Ace08 Posted September 28, 2010 Author Share Posted September 28, 2010 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 Link to comment Share on other sites More sharing options...
wakillon Posted September 28, 2010 Share Posted September 28, 2010 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 ! VenusProject2 1 AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Ace08 Posted September 28, 2010 Author Share Posted September 28, 2010 thank you so much for the help wakillon Work smarter not harder.My First Posted Script: DataBase Link to comment Share on other sites More sharing options...
wakillon Posted September 28, 2010 Share Posted September 28, 2010 thank you so much for the help wakillon Glad to help you ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
sebastiian Posted November 7, 2018 Share Posted November 7, 2018 ¿Y como quedaría el código? Link to comment Share on other sites More sharing options...
sebastiian Posted November 7, 2018 Share Posted November 7, 2018 2 minutes ago, sebastiian said: ¿Y como quedaría el código? $sTextFile = "C:\hola_mundo.txt" Run ( "notepad.exe " & $sTextFile, @WindowsDir, @SW_MAXIMIZE ) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now