Reply to topic  [ 4 posts ] 
Renaming files in windows - how? 
Author Message
What's a life?
User avatar

Joined: Thu Apr 23, 2009 6:27 pm
Posts: 12251
Reply with quote
This is something that came up in CodeClub. We’re bashing out HTML and CSS using NotePad (yay). The easiest way to make a new file is to right click in a Filer window and choose to make a new text file form there.

However, we want the correct extensions - .html and .css - but can’t change them. All we get are files called index.txt.html and style.css.txt. How do we change the extension properly? Right clicking to get the file’s properties does not let us change the extension.

Remember, locked down PCs, so some preferences are not available to us (and quite frankly, we should leave various preferences alone anyway as it could cause confession elsewhere - 10 & 11 year olds).

The best option we have is to create a new file in NotePad and save that to where we want. It just seems a right faff when we can create a file in the folder we want from the off.

Oh, because of school finances, we’re on Windows Vista. Plans to buy new computers are in the works, but I don’t expect them to appear anytime soon.

EDIT: To clarify, we can click on the filename and type in the name we want - such as "index.html" - but it .txt extension can’t be removed doing this.

_________________
All the best,
Paul
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation


Tue Dec 06, 2016 12:42 pm
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 7:26 pm
Posts: 17040
Reply with quote
IIRC what's happening is most of the files already have an extension but windows is just hiding them from you. IIRC there is a file explorer preference to make all file extensions visible, and then you will actually be able to rename things if you want to.

Also, if you put the filename in quotes when you save it, the app won't add an extension. So, say you have a notepad file with HTML code in it (ah, takes me back.... anyway...) if you just type index.html in the filename field in the save dialog, Notepad will helpfully add the .txt extension on, as Notepad is after all a text file editor. However, if you type "Index.html" in the filename field in the save box, that's exactly the filename your file will have - just index.html


Tue Dec 06, 2016 6:51 pm
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 6:27 pm
Posts: 12251
Reply with quote
jonbwfc wrote:
IIRC what's happening is most of the files already have an extension but windows is just hiding them from you. IIRC there is a file explorer preference to make all file extensions visible, and then you will actually be able to rename things if you want to.

Also, if you put the filename in quotes when you save it, the app won't add an extension. So, say you have a notepad file with HTML code in it (ah, takes me back.... anyway...) if you just type index.html in the filename field in the save dialog, Notepad will helpfully add the .txt extension on, as Notepad is after all a text file editor. However, if you type "Index.html" in the filename field in the save box, that's exactly the filename your file will have - just index.html


Thanks. In Notepad, you can add your own extension without any problems in the Save window. It's the files you can create without starting Notepad that are the ones that are the problem.

I'll see if a I can find a File Explorer option, and see if those can be changed. I'm not sure how nailed down preferences are on the computers the kids have access to.

_________________
All the best,
Paul
brataccas wrote:
your posts are just combo chains of funny win

I’m on Twitter, tweeting away... My Photos Random Avatar Explanation


Tue Dec 06, 2016 8:01 pm
Profile
What's a life?
User avatar

Joined: Thu Apr 23, 2009 8:25 pm
Posts: 10691
Location: Bramsche
Reply with quote
If you switch from File Type "*.txt" to "all files" in the save dialog, then it won't append .txt to the end of the file.

In Explorer, the default in Windows is to "hide" known file extensions. The only way to get this to work is to go into the options and remove the one that says "hide known file extensions" (or similar, I translated from my German version of Windows). But that is a question of whether that option is locked down or not.

It is always the first option that I disable on a new machine!

Other than that, you can call up a command line and rename the file using the ren command (ren test.html.txt test.html)

A better option, if you are writing code is to use Notepad++, it is free and does source code marking (uses different colours, tells you if opening or closing <> () [] {} are missing etc.). It supports most major languages, from HTML, CSS etc. through C, C++, Java, JavaScript, Perl etc.

_________________
"Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari

Executive Producer No Agenda Show 246


Wed Dec 07, 2016 6:00 am
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.