Sign in to follow this  
Followers 0
DaLiMan

Opening File.txt

4 posts in this topic

I can't open my file, I tried the HELP file and some code like this but nothing opens my .txt file

Run("C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt", "", @SW_MAXIMIZE)

Run("Notepad.exe", "C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt", @SW_MAXIMIZE)

RunWait(@ComSpec & " /c " & 'C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt', "", @SW_HIDE)

Can anyone help me with this one?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Run("C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt", "", @SW_MAXIMIZE)

The .txt files are not executables. So this cant work.

Run("Notepad.exe", "C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt", @SW_MAXIMIZE)

In this case you are trying to open Notepad from the C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt FOLDER!

Of course it cant work...

RunWait(@ComSpec & " /c " & 'C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt', "", @SW_HIDE)

See, first one.

Correct:

Run('notepad "C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt"', "", @SW_MAXIMIZE)

;The same of other.

RunWait(@ComSpec & ' /c start "" ' & '"C:\Documents and Settings\Default User\Local Settings\Temp\ArtNRFail.txt"', "", @SW_HIDE)

If you are using a Win9x kernel system remove the two "s near "start"

Edited by ezzetabi

Share this post


Link to post
Share on other sites

Thanx for your help and explanation. :ph34r:

Works like a charm!

Greetings,

DaLiMan

Share this post


Link to post
Share on other sites

You are welcome, but RTFM! :ph34r:

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