Is there any way to add something of the sort to the "New ..." menu in
File Manager?
I recently wanted to create a .css file, for example. The only way I
know is to create a new text file (that's the only option that makes a
file of zero size), then rename it, accepting the warning about changing
the extension. (Or create and edit it as a text file, then have to
fiddle with the name in the save function in Notepad or whatever editor.)
Is there any way to add something of the sort to the "New ..." menu in
File Manager?
I recently wanted to create a .css file, for example. The only way I
know is to create a new text file (that's the only option that makes a
file of zero size), then rename it, accepting the warning about changing
the extension. (Or create and edit it as a text file, then have to
fiddle with the name in the save function in Notepad or whatever editor.)
Is there any way to add something of the sort to the "New ..." menu in
File Manager?
Is there any way to add something of the sort to the "New ..." menu inThere seems to be. I'm not able to get to my Windows machine to verify this but I've
File Manager?
I recently wanted to create a .css file, for example. The only way I
know is to create a new text file (that's the only option that makes a
file of zero size), then rename it, accepting the warning about changing
the extension. (Or create and edit it as a text file, then have to
fiddle with the name in the save function in Notepad or whatever editor.)
Is there any way to add something of the sort to the "New ..." menu in
File Manager?
I recently wanted to create a .css file, for example.
The only way I
know is to create a new text file (that's the only option that makes a
file of zero size), then rename it,
accepting the warning about changing the extension.
You are right, that requires an extra <RETURN>, so in total it
makes 6 additional keystrokes, but as a reward you get a clean
right-click menu.
On Mon, 7/28/2025 7:39 AM, J. P. Gilliver wrote:
Is there any way to add something of the sort to the "New ..." menu in
File Manager?
I recently wanted to create a .css file, for example. The only way I
know is to create a new text file (that's the only option that makes a
file of zero size), then rename it, accepting the warning about changing
the extension. (Or create and edit it as a text file, then have to
fiddle with the name in the save function in Notepad or whatever editor.)
There probably is a way to make a .css file from a menu.
In Notepad, setting the filetype to "All Files" and saving as "some.css" seems to give a CSS file without a .txt glued to the end. It does not
look like the operation is that much of a trauma, to be done manually :-)
But making a menu with the creation capability for 200 item types,
does that make sense ? That's what we have to ask. On Linux, there
In article <1067nhn$21tqk$[email protected]>, [email protected] says...
Is there any way to add something of the sort to the "New ..." menu in
File Manager?
I recently wanted to create a .css file, for example. The only way I
know is to create a new text file (that's the only option that makes a
file of zero size), then rename it, accepting the warning about changing
the extension. (Or create and edit it as a text file, then have to
fiddle with the name in the save function in Notepad or whatever editor.)
I asked Perplexity.ai: "In Windows, when you right click within a
folder or on the desktop, the context menu offers options to create New
files of various types. How can I add to that list, so that I could
create, for example, a new file of type .css?"
Here's what it came back with:
To add a file type like .css to the Windows context menu's "New" submenu (shown when you right click in a folder or on the desktop), you need to
edit the Windows Registry. Here?s a step-by-step guide for adding a new
.css file option:
Steps to Add a .css File Option
Open the Registry Editor
Press Windows + R, type regedit, and hit Enter.
Navigate to the Right Location
Go to: HKEY_CLASSES_ROOT
Scroll down to find the extension you want. If .css is not present,
create it:
Right-click on HKEY_CLASSES_ROOT
Select New > Key
Name the key: .css
Create the ShellNew Key
Right-click on the .css key you just created
Select New > Key
Name this new key: ShellNew
Add the NullFile Value (for a blank .css file)
With ShellNew selected, right-click in the right pane
Select New > String Value
Name it: NullFile
Leave its value empty
This will create a new blank .css file when you choose "New > Cascading
Style Sheet Document" from the context menu.
Optional step: If you want new .css files to contain template content, instead of NullFile, use a string value named FileName and set it to
point to a template file (such as css.css in C:\Windows\ShellNew\):
text
"FileName"="css.css"
Applying Changes
Restart File Explorer (or reboot) for the new menu item to appear.
Sample Registry Entry
If you prefer, you can create a .reg file with the following contents,
then run it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.css]
@="cssfile"
[HKEY_CLASSES_ROOT\.css\ShellNew]
"NullFile"=""
Save this into a file like add-css-to-context-menu.reg and double-click
it to add the entry.
After completing these steps, you will see "Cascading Style Sheet
Document" (.css) as an option in your right-click "New" menu, letting
you quickly create new .css files wherever you need them.
I was just wondering, if there's any way to add - say - "new file", that would let you specify any (or no!) extension when you typed in the name.
Thinking about it, that wouldn't save you _that_ much time, as you'd
still have to select which editor when you wanted to actually put
something _in_ it after creating it. (Though I have vague memory of
some way to specify an editor to be used for any [all] "unknown" types.)
(This reply is by email)
On 2025/7/28 17:51:39, R.Wieser wrote:
J.P. ,
I was just wondering, if there's any way to add - say - "new file", that >>> would let you specify any (or no!) extension when you typed in the name.
On my machine that is what happens by default : if you forget the extension >> none is used. When you use an extension than that one is used. In both
cases you get a warning though
I think we're talking about different things. I'm talking about right-clicking in a folder (in File Explorer), and selecting New: that
offers Folder, Shortcut, and (in my case) ten filetypes, from Windows
Batch File to Text Document. You can't "forget" the extension - when you select one of the options, it preloads the extension (e. g. if you
select Text Document, it creates "New Text Document.txt", with the part before the dot highlighted for you to tye-replace. (IIRR, on 7 and
earlier it created "Untitled.txt", again with the first part highlighted.)
[]
You can give the .css entry in the registry some stuff to mimic the .txt
[]
I wasn't trying to add a _specific_ new type (such as .css); I was
wondering if there was any way to add a _generic_ "new file" to the list
(of things it can create).
On my machine that is what happens by default : if you forget the
extension none is used. When you use an extension than that one
is used. In both cases you get a warning though
I think we're talking about different things. I'm talking about
right-clicking in a folder (in File Explorer), and selecting New:
You can't "forget" the extension - when you
select one of the options, it preloads the extension (e. g. if you
select Text Document, it creates "New Text Document.txt", with
the part before the dot highlighted for you to tye-replace.
I wasn't trying to add a _specific_ new type (such as .css); I was
wondering if there was any way to add a _generic_ "new file" to the
list (of things it can create).
J. P. ,
On my machine that is what happens by default : if you forget the
extension none is used. When you use an extension than that one
is used. In both cases you get a warning though
I think we're talking about different things. I'm talking about
right-clicking in a folder (in File Explorer), and selecting New:
Don't worry, we are talking about the same thing.
You can't "forget" the extension - when you
select one of the options, it preloads the extension (e. g. if you
select Text Document, it creates "New Text Document.txt", with
the part before the dot highlighted for you to tye-replace.
Well, that is different from what happens on my XP machine - there the whole name (including the extension) is hi-lited. Which sometimes leads to me start typing a new filename and by it loosing the suggested filename, and ofcourse the the extension too.
I wasn't trying to add a _specific_ new type (such as .css); I was
wondering if there was any way to add a _generic_ "new file" to the
list (of things it can create).
To be honest, I never thought about creating a file without an extension, as it was, under XP, too easy to delete the extension.
I wasn't trying to add a _specific_ new type (such as .css); I was
wondering if there was any way to add a _generic_ "new file" to the
list (of things it can create).
The only time I've dealt with an extensionless file (apart from some
_really_ old ones - 1990s or earlier?, from before standard extensions
became a thing! - is the hosts file: see threads here passim.
I wasn't trying to add a _specific_ new type (such as .css); I was
wondering if there was any way to add a _generic_ "new file" to
the list (of things it can create).
"file" uses the magic number to identify the file type. It doesn't care
what the extension is. Linux overall also doesn't generally care either.
On linux I would use the 'touch' command to create whatever empty new file
I wanted. No need for a gui or mouse clicks.
J. P. ,
The only time I've dealt with an extensionless file (apart from some
_really_ old ones - 1990s or earlier?, from before standard extensions
became a thing! - is the hosts file: see threads here passim.
Same here - although a quick check just now shows there are a number of them in the Windows folder-tree (none for the user though).
Regards,
Rudy Wieser
On 2025/7/29 8:10:50, R.Wieser wrote:If you use Thunderbird, it has always used an extensionless file for the
J. P. ,
[]
The only time I've dealt with an extensionless file (apart from some
_really_ old ones - 1990s or earlier?, from before standard extensions
became a thing! - is the hosts file: see threads here passim.
Same here - although a quick check just now shows there are a number of them >> in the Windows folder-tree (none for the user though).
Regards,
Rudy Wieser
Just out of curiosity - how did you find that out? Looking for no
extensions sounds challenging!
dir /s *.
maybe?
Same here - although a quick check just now shows there are a number
of them in the Windows folder-tree (none for the user though).
Just out of curiosity - how did you find that out? Looking for no
extensions sounds challenging!
dir /s *.
maybe?
J.P. ,
Same here - although a quick check just now shows there are a number
of them in the Windows folder-tree (none for the user though).
Just out of curiosity - how did you find that out? Looking for no
extensions sounds challenging!
dir /s *.
maybe?
Pretty-much, yes. :-)
dir /s /b /a-d *.
The "/b" to get whole filepaths, the "/a-d" to get rid of the
subdirectories.
Regards,
Rudy Wieser
It is amazing what you can do with the old Dos Batch file commands.
Some years ago I worked for a company where IT tied all computer up so
they would be secure. You could basically run approved programs and type from the keyboard. EXCEPT they forgot about the BATCH commands.
I used them to create a database of some files on their system, saved me a lot of typing.
Knuttle,
It is amazing what you can do with the old Dos Batch file commands.
Command line commands actually. But yes, they also worked in batch files. :-)
https://thedailywtf.com/articles/Classic-WTF-The-Indexer
J.P. ,
I wasn't trying to add a _specific_ new type (such as .css); I was
wondering if there was any way to add a _generic_ "new file" to
the list (of things it can create).
I could not drop the issue, and googled for how it could/would work on XP. The first result was this one :
https://superuser.com/questions/1632295/creating-a-file-with-no-extension-with-right-click-on-windows-10
:-)
The whole "trick" seems to be to press ctrl-A to select the whole filename.
Regards,
Rudy Wieser
Knuttle,
It is amazing what you can do with the old Dos Batch file commands.
Command line commands actually. But yes, they also worked in batch files. :-)
Some years ago I worked for a company where IT tied all computer up so
they would be secure. You could basically run approved programs and type
from the keyboard. EXCEPT they forgot about the BATCH commands.
Don't blame them (to harshely). Even MS has dropped the ball in that : I've still got the instructions with which to bypass W98 login procedure - and
its surprisingly easy (using their OS against them).
I used them to create a database of some files on their system, saved me a >> lot of typing.
That makes me remember this story :
https://thedailywtf.com/articles/Classic-WTF-The-Indexer
:-)
Regards,
Rudy Wieser
Command line commands actually. But yes, they also worked in batch
files. :-)
Yes, I admired that knowledge of dir's switches!
https://thedailywtf.com/articles/Classic-WTF-The-Indexer
I found that depressingly believable.
https://superuser.com/questions/1632295/creating-a-file-with-no-extension-with-right-click-on-windows-10
The whole "trick" seems to be to press ctrl-A to select the whole
filename.
That method - running the file through a text editor so you can use
quote marks when saving
The better method is to ensure "show extensions [even] for known
filetypes"
is selected, then you can edit including the extensions without running
the
files through anything.
That should have been the default for that option for decades, ever
since black hats started to use double extensions to hide malware.
One thing about "dir", is it is hella-fast as code goes.
Other ways of enumerating a file tree, don't go that fast.
Knuttle,
It is amazing what you can do with the old Dos Batch file commands.
That makes me remember this story :
https://thedailywtf.com/articles/Classic-WTF-The-Indexer
In article <106b8gk$2rau6$[email protected]>, [email protected]d says...
...
Knuttle,
It is amazing what you can do with the old Dos Batch file commands.
That makes me remember this story :
https://thedailywtf.com/articles/Classic-WTF-The-Indexer
You could do even more with Unix shell-scripting - presumably still availablein Linux, and something similar's available with PowerShell
(never learned either as it happens).
Years ago (mid- 90s) the head of my department called me into his
office. Had a project for me, likely to last 6m or so. He described it
- a way of grooming a live feed so that stats could be displayed on one
of these new-fangled "web pages". Realisation dawned as he spoke. I
asked if I could come back to him in an hour's time. He was puzzled,
but agreed.
An hour later I explained that I'd assembled a series of shell-script fragments that I'd been gradually accumulating over the last year into a utility that would do exactly what he wanted, crucially using the
relational "JOIN" script command. It would need a little tidying up in
terms of the exact display, but it was working. Right now, at my desk upstairs.
He just didn't get it. He said he would "drop by" and take a look, but
he never did. And a week later, one of my colleagues was given the same project. He was still trying to write C++ code six months later. Yet
within an hour of being asked, I'd had a working prototype running on my screen. Didn't do me any good, actually. That was meant to be a plum project, and I was overlooked after that. (I left.)
In another role, I'd come in one morning to find my then boss sizzling
over his keyboard. He'd been given a large (!) file of data including a "code" for a location in a vast network. Unfortunately the other data
that was to be used had the code formatted very slightly differently -
the human eye could make the translation trivially, but matching it electronically was impossible, it seemed. He'd come in just after dawn
and had been working in a text editor manually changing the codes for
two hours by the time I arrived. The progress indicator still showed
0%.
"Would you like me to do that for you?" I asked. He practically kicked
his chair down the hall. I got him to explain the exact naming
convention, and spent ten minutes studying both files of data, and
writing a shell "pipeline" using "SED", the only utility capable both of "regular expressions" and handling a file of arbitrary size. I closed
his edit session (cheekily telling it not to bother saving changes) and
ran my script. It ran for ten minutes, and fixed every single code.
Then there was the project based on an object-oriented database (which
didn't seem to work after a month's hard work on it) which I replaced
with a shell-script I'd written in two hours for a customer demo which
had been sprung on me at 24 hours' notice. My then boss subsequently
went off into rhetorical flights about how this COULD NOT HAVE BEEN
ACHIEVED in just one month without using "advanced programming
techniques" like the latest object-oriented database. I only told him afterwards.
DOS scripting never had the power or fluency of Unix shell-scripting,
but although I find the "look" of PowerShell rather off-putting I think
it very likely that PS could do all this - it's just a shame I've never
had any reason to learn it. But if you're a Linux user, check to see if
SED and AWK and JOIN (etc) are still available. If so, you're sitting
on some real data processing power there.
--
Phil, London
But yes, its quite possible that me having changed the OS configuration when I installed it to always show extensions just /might/ have something to do with me always seeing and being able to edit the full filename. <whistle>
You cannot safely or efficiently run with the default setting.
jugofwine (some little icon you can't make out)...
jugofwine.txt...
jugofwine (some little icon which is not the same as the other one)
jugofwine.jpg
When you can't make out the icon, the extension adds the distinction required.
In article <106b8gk$2rau6$[email protected]>, [email protected]d says...I could be wrong but as I remember Powershell was just a CMD that was
...
Knuttle,
It is amazing what you can do with the old Dos Batch file commands.
That makes me remember this story :
https://thedailywtf.com/articles/Classic-WTF-The-Indexer
You could do even more with Unix shell-scripting - presumably still availablein Linux, and something similar's available with PowerShell
(never learned either as it happens).
Years ago (mid- 90s) the head of my department called me into his
office. Had a project for me, likely to last 6m or so. He described it
- a way of grooming a live feed so that stats could be displayed on one
of these new-fangled "web pages". Realisation dawned as he spoke. I
asked if I could come back to him in an hour's time. He was puzzled,
but agreed.
An hour later I explained that I'd assembled a series of shell-script fragments that I'd been gradually accumulating over the last year into a utility that would do exactly what he wanted, crucially using the
relational "JOIN" script command. It would need a little tidying up in
terms of the exact display, but it was working. Right now, at my desk upstairs.
He just didn't get it. He said he would "drop by" and take a look, but
he never did. And a week later, one of my colleagues was given the same project. He was still trying to write C++ code six months later. Yet
within an hour of being asked, I'd had a working prototype running on my screen. Didn't do me any good, actually. That was meant to be a plum project, and I was overlooked after that. (I left.)
In another role, I'd come in one morning to find my then boss sizzling
over his keyboard. He'd been given a large (!) file of data including a "code" for a location in a vast network. Unfortunately the other data
that was to be used had the code formatted very slightly differently -
the human eye could make the translation trivially, but matching it electronically was impossible, it seemed. He'd come in just after dawn
and had been working in a text editor manually changing the codes for
two hours by the time I arrived. The progress indicator still showed
0%.
"Would you like me to do that for you?" I asked. He practically kicked
his chair down the hall. I got him to explain the exact naming
convention, and spent ten minutes studying both files of data, and
writing a shell "pipeline" using "SED", the only utility capable both of "regular expressions" and handling a file of arbitrary size. I closed
his edit session (cheekily telling it not to bother saving changes) and
ran my script. It ran for ten minutes, and fixed every single code.
Then there was the project based on an object-oriented database (which
didn't seem to work after a month's hard work on it) which I replaced
with a shell-script I'd written in two hours for a customer demo which
had been sprung on me at 24 hours' notice. My then boss subsequently
went off into rhetorical flights about how this COULD NOT HAVE BEEN
ACHIEVED in just one month without using "advanced programming
techniques" like the latest object-oriented database. I only told him afterwards.
DOS scripting never had the power or fluency of Unix shell-scripting,
but although I find the "look" of PowerShell rather off-putting I think
it very likely that PS could do all this - it's just a shame I've never
had any reason to learn it. But if you're a Linux user, check to see if
SED and AWK and JOIN (etc) are still available. If so, you're sitting
on some real data processing power there.
--
Phil, London
On 2025/7/29 9:3:25, R.Wieser wrote:
That should have been the default for that option for decades, ever
since black hats started to use double extensions to hide malware.
J.P. ,
https://superuser.com/questions/1632295/creating-a-file-with-no-extension-with-right-click-on-windows-10
The whole "trick" seems to be to press ctrl-A to select the whole
filename.
That method - running the file through a text editor so you can use
quote marks when saving
Thats not what I tried to suggest.
You mentioned that, when creating a new document, you could edits the filename itself, but not the extension. At that moment try pressing ctrl-A and see if that results in the extension also getting selected for editing.
... but reading on I think I made an assumption which has made a fool outof me :
The better method is to ensure "show extensions [even] for known
filetypes"
is selected, then you can edit including the extensions without running
the
files through anything.
I /assumed/ that you saw, after creating a new document, something like "[filename].ext", with only the part beween the "[" and "]" being editable.
Which, from my POV, didn't seem too strange, as most people will want to
keep the extension when changing the filename.
The ctrl-a "trick" was, I assumed, to change the above into "[filename.ext]" (making the full filename editable).
But yes, its quite possible that me having changed the OS configuration when I installed it to always show extensions just /might/ have something to do with me always seeing and being able to edit the full filename. <whistle>
That should have been the default for that option for decades, ever
since black hats started to use double extensions to hide malware.
I do not agree with you there.
Most users are just that, *users*. They know which icon they need to click on their desktop, but often no more than that. They really need to be protected against their own absense of knowledge (the same reason for why certain OS related files are hidden). Making sure that they can change a filename but not inadvertedly throw the extension away (after which the icon changes and they cannot find the file back and/or double-click it to open
it) is one of those protections.
Remember all those stories about users which tried to "clean up" their 'puters by throwing all files away they did not recognise - and than complained that their 'puter would not start anymore ? Yeah
that happens when you "clean up" the OS folder that way. :-)
But for "power"-users ? Certainly. But they are knowledgable enough to disable such hand-holding protections in the configuration just after having installed the OS. As yours truly has done, and absolutily forgotten about. :-|
As for the "black hat" example you've given ? AFAIK the OS tries to warn you with a popup when you try to start downloaded executables. What does
the run-of-the-mill user ? Figure out which choice makes the popup go away and than blindly apply it, without even reading what it tries to tell them
(yeah, I have been shoulder-surfing a number of such users, just to figure out what went "wrong" on their machine - a popup comes up and within half a second its been clicked away). :-\
As such I expect one of the future Windows versions to have a default configuration that prohibits the user from running any executable (of any kind) that has somehow been copied into it (downloaded, thumbdrive, etc).
Regards,
Rudy Wieser
I could be wrong but as I remember Powershell was just a CMD that
was giving administrative privileges. In the current Windows 11 they are called Terminal and Terminal (admin). both accept the old DOS commands
just differing in what they can access.
On Tue, 29 Jul 2025 22:51:54 +0100, J. P. Gilliver wrote:
On 2025/7/29 9:3:25, R.Wieser wrote:
[snip]
That should have been the default for that option for decades, ever
since black hats started to use double extensions to hide malware.
Do you mean something like this?
info.txt.exe
That's not really "double extension". The extension is .exe, but Windows
(by default) makes it look like .txt but that is not an extension (which explains why its not hidden too). Click on the file and Windows knows the extension is .exe.
BTW, I always turn that lying option off.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 156:50:34 |
| Calls: | 12,093 |
| Calls today: | 1 |
| Files: | 15,000 |
| Messages: | 6,517,741 |