Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Change

Sep 6, 2004 7:55PM PDT

I frequently use notepad to save small files as ".html". It is a long story, but I must use Notepad, not any other options. Is there a way to set up Notepad to default the "save as" to an .html file? (notepad always uses ".txt" as default)

Thank You!

Discussion is locked

- Collapse -
Re: Change
Sep 6, 2004 11:04PM PDT

Since notepad has been around a decade, I'm unsure why, after this much time you haven't found the answer.

Did you research this with google.com?

Why not?

Bob

- Collapse -
Re: Change
Sep 7, 2004 4:25PM PDT

Yes, I did research this with Google, and did not find any solutions.

Why does it matter?

- Collapse -
It matters because that is your answer.
Sep 7, 2004 9:45PM PDT

It's like asking for the solutions to the Navier Stokes equations and you already know the answer. You can edit notepad.exe in a hexeditor or just replace notepad with some dozen replacements.

My response is because I wonder why you asked.

Bob

- Collapse -
Re: Change to Notepad
Sep 7, 2004 4:13AM PDT

Yes, and I don't have the answer here, but I know it can be done.
You will need a Hex Editor (or maybe you might call it a byte editor, whatever). With that sort of editor, you can open up the Notepad.exe and change the built-in code of the extension ".exe" to ".htm" and then save that altered file over top of the old Notepad.exe

The reason you want to use ".htm" instead of ".html" (either will be understood by Windows that it is an HTML file) is that you may not want to squeeze in 4 bytes ("html") into the 3 byte ("txt") space.
Doing so will bump out all the remaining code and may make the remaining code (all bytes after your addition of that one extra byte) to be corrupted.

If you are to follow that path, I would suggest that you first save off the original Notepad.exe so that you can still get easily back to the original if you want to.

And then finally, by having an altered Notepad.exe you may now be doing the very thing that you say CAN'T do (because it is a long story? ... longer than this message? Happy ). You would be using something other than the original Notepad. You now have changed to a somewhat unique Notepad.

EASIEST SOLUTION would be for you to just type in the .html. or .htm right into the "File name" field, thus over-riding the default .txt extension. That way you haven't modified any code, you just take the one extra second or two to enter the extension you want. It is a slight behavior modification. Take will take less time (initially) than to figure out what bytes to modify within the Notepad program.

If you later want to open some HTML file with Notepad, just right-click the file and select [Open With] (your version of Windows may require you to hold down SHIFT to get the right-click option of [Open With] to appear) and select Notepad.

- Collapse -
I'm confused. Can you clarify?
Sep 8, 2004 2:16AM PDT

Changing the file extension to htm is not the same as writing a file in html format. Are you saying that Notepad or Windows will convert to an html format? If it did that, it would be quite interesting.

- Collapse -
HTML code is just TEXT
Sep 8, 2004 4:27AM PDT

You said you ?frequently use notepad to save small files as .html. ?
And then you asked ?Is there a way to set up Notepad to default the "save as" to an .html file?

I am not suggesting that Notepad can automatically do anything (Exception: there is one thing it can automatically do, but that has nothing to do with html files, ask me if you want to know what that is). I just figured that if you are already an HTML coder (a person who is familiar enough with HTML code to type and/or read the ?<whatever> </whatever>? HTML tags) and are glutton enough to use Notepad as the editor, that you were asking if Notepad can automatically save to the ?.html? (or, my suggestion, the ?.htm?) extension.

There is nothing special about the HTML file format that prevents any text editor from opening, editing, or saving HTML files. HTML code is all text. What makes HTML coding special is the viewer used to open an HTML file as it is meant to be viewed, and that is in a browser. A browser will take all those HTML codes and perform screen manipulation to adjust for fonts, lines, color, graphics, etc.

So, any text editor (I expect) can save files with the .HTML, .HTM, file extension.
I just said that you can use a Hex editor to have Notepad automatically append the HTM extension to your desired filename.
There is no ?conversion? involved; it is just an extension issue.

You can take any .HTML file now, and rename it to a .TXT extension and open it with Notepad (barring some possible file size restrictions).

- Collapse -
For Chuck.
Sep 8, 2004 4:33AM PDT

Look at the person's prior posts and you'll see a pattern emerge. They may be baiting you.

Bob

- Collapse -
Re: For Chuck.
Sep 8, 2004 5:24AM PDT

I don't see it Bob, but thanks for the cautionary.

I only see two posts from "raff98"

I'll try to answer innocent enough questions, depending upon my available time, and patience.

- Collapse -
OK, that makes sense. I read the question as
Sep 8, 2004 11:49AM PDT

converting a text document to HTML format. In other words, adding all the necessary tags. Yes, I do know that HTML is just text.

- Collapse -
Re: Change
Sep 10, 2004 8:00AM PDT

HTML or Hyper Text Markup Language is a simple programming language (take note - programming language like Java, C++, assembler, etc.) created to write pages for the Web.
Notepad on the other hand is like MS Word or any word editing programs that Windows use as a default reader for text files especially for large files.
Why not use MS Word instead or any popular editing programs like Word Perfect?
Take note that when using an HTML or HTM file format, it reserves specifics for pasting encryptions, embedded pictures and the like which Notepad has limitations.
If you check your file when saved in HTML format using Windows Explorer, you will find that the icon is encrypted as internet explorer while Notepad is in plain text or letters.
In addition, double clicking (thru windows explorer) a file in an HTML format will take you to the website of the original source of the HTML file (that is if you are on-line).