Solved

Opening txt files from web automatically in notepad

Posted on 2008-06-11
6
5,154 Views
Last Modified: 2013-12-08
Hi!

I am trying to open txt files from web automatically in notepad e.g i want this link to open in notepad instead of Internet explorer. : http://www.whitehouse.gov/robots.txt

Thank you
A
0
Comment
Question by:itscdoorway
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21757642
Well that's because IE sees this as a document it can open itself as it's a recognised filetype in the shell sysyetm and IE is a compatible program.

With .net from memory you can use the code below to show IE it's an attachment and it should open an external program, but that's if you are making your own page to serve txt files...

Also this has been recommended as a solution for your own machine, but it won't do it on everyone elses unless they follow the instructions...

"The "Browse in same window" option for the file extensions for ".txt" is
disabled. But after I delete the "TXT" file extensions and recreate the "TXT"
file extensions and set configure "notepad" to open it. The plain txt will not
use IE to open. It is prompted to use notepad to open the txt file."

This means you need to remove the filetype .txt from your list of know file types and then re add it but only list notepad as a compatible file - not everyone is will to do that; but if this is a problem just for you and your PC - try it.
Do you have the http-header Content-Disposition=attachment ?
 
Response.AppendHeader("Content-Disposition", "attachment");
 
or even
 
Response.AppendHeader("Content-Disposition",
"attachment;filename=file.txt");

Open in new window

0
 
LVL 50

Expert Comment

by:jcimarron
ID: 21763742
itscdoorway--I assume when you say "open...automatically in Notepad", you mean when you click on a .txt file.  
Change the association of .txt files so they open in Notepad.  Right click on any .txt file|Open With|Choose Program (even if you see Notepad in the first group of programs offered).  Highlight Notepad, check the box at the bottom left "Always use the specified program to open this kind of file"|OK.
0
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21767342
Well that's pretty much what I said 'file association', the problem being is that as the file is a file associated with Explorer, even though it's not the primary program (ALWAYS USE) it's still associated so explorer opens it.

What's needed is to remove internet explorers association completely to a TXT file so it doesn't presume it can open it to save the user and system time opening another program.
0
RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

 
LVL 1

Author Comment

by:itscdoorway
ID: 21768523
This didn't help, I tried to associate the txt file to ONLY be opened with notepad. Tried access http://www.whitehouse.gov/robots.txt again, but still the txt file is opened in IE. I also tried to delete the txt under file types, but still it's opening in IE...
0
 
LVL 50

Accepted Solution

by:
jcimarron earned 250 total points
ID: 21771227
itscdoorway--On my PC, .txt files are set to open with Notepad (Windows Explorer|Folder Options|File Types).  If I click a .txt file already on my hard drive it opens, as it should, in Notepad.  If I click on a .txt link in an IE page, however, it opens, as you say, in IE.  
If nothing else works, a simple work around is to right click .txt files in webpages|Open With and cick Notepad.
0
 
LVL 1

Author Comment

by:itscdoorway
ID: 21776404
Or simply open the link with .txt ending in IE and right click in the "txt file"  then choose "View source" :)

Thanks for the tip jcimarron, that was the little tip I needed.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
close pop up windows when logout or main window closes 17 86
ow do I browse the internet secretly? 6 97
Chrome VM 1 38
ad on top left of youtube video 3 30
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question