Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Open txt file using default program on Windows

by Jim (Curate)
on May 31, 2013 at 23:22 UTC ( #1036349=note: print w/ replies, xml ) Need Help??


in reply to Open txt file using default program on Windows

Curiously, this works on my Microsoft Windows computer. It opens the file named foo.txt in Notepad.

C:\>perl -e "system('foo.txt')" C:\>assoc .txt .txt=txtfile C:\>ftype txtfile txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1 C:\>

I've never written a Perl script that opens a text file in Notepad (or any interactive text editor), and I can't imagine why anyone else would.


Comment on Re: Open txt file using default program on Windows
Download Code
Re^2: Open txt file using default program on Windows
by BrowserUk (Pope) on May 31, 2013 at 23:44 UTC
    I've never written a Perl script that opens a text file in Notepad (or any interactive text editor), and I can't imagine why anyone else would.

    See perlbug.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      What's in perlbug about invoking Notepad with Perl?

        C:\test>perlbug ... You will probably want to use a text editor to enter the body of your report. If "notepad" is the editor you want to use, then just press Enter, otherwise type in the name of the editor you would like to use. If you have already composed the body of your report, you may enter "file", and c:\perl64\bin/perlbug.bat will prompt you to enter the name of the file containing your report. Editor [notepad]:

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1036349]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-11-28 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (200 votes), past polls