Showing posts with label explorer. Show all posts
Showing posts with label explorer. Show all posts

Tuesday, 13 February 2018

Windows : Com File Effect

I'll never claim to know everything about Linux nor Windows, I know a lot more about the former than the latter, mainly as the Windows is a closed source product.  As such it doesn't get my attention as much, unless something is going wrong.... Today I have found an effect I can't explain (at least not easily) in windows, clearly it's some sort of reserved file name or type effect.... Maybe you can explain this to me.

So, open any folder, right click and go to create a new text file...


Once you have the file...


Change the name to "COM" and a port number, so "COM1" in my case.... It can be any COM port name, even if you don't have that port installed or active on your machine....


Once you complete the name, or change focus of the text entry (by say taking a screen shot - not actually committing the new file to disk) you get this strange message...


"The Specified device name is invalid"....

What device?  I'm trying to create a filename.  I was immediately a little puzzled, I've used Windows since Windows 2.0  I've never ran into this issue.

Googling around I find a chap on social.technet.microsoft.com saying not to use a whole plethora of names for files or folder as they're reserved, I have never heard of this.

The official Microsoft advice likewise says not to use these values, and it kindled a memory in me from programming in DOS 6 back in the mid 90's, one would in Pascal, you could "println(PRN, 'some message');" and see the message print out on the printer.

I find it amazingly odd that these files are still reserved in 2018, they're proper nouns, they're things you may want to name files, and they have a FULL Path, which makes them very distinct than the COM port device.  Its odd, trust me.

But the oddest thing is, what does Windows do, what is the piece of code picked up and made to run that message box upon creation of the file?  And I've got to wonder how exploitable that maybe in local malware to open lots of message boxes and annoy the user.

Thursday, 12 May 2016

Failed Windows versus Linux Rant

I'll be honest, I was coming to write to you all today to give windows another well-deserved roasting.  Unfortunately, I found the same issue in Linux.  Well, when I say issue, perhaps this is my own expecting something more logical from a system.

Lets take a look at the folder I'm talking about:
  
It's any folder you like, within it, I've created a folder called ".example", another without the leading period "example" and then a file which includes the word "example" within it's file name.

When I go to search this directory, with the explorer search bar within the window presented, I expect it to work by using exactly what I type...

So, if I search for "txt", only the "example.txt" file should come up, and it does...

But if I search for "example", I'm getting three results, as they contain the word, therefore I aim to be more specific and search for ".example"... The result of this last search:


Yup, I still get all three results.  Clearly only one item matches ".example", and this annoys me.

And I jumped to Linux to take screen shots of this not working this way, but I found ls does work this way too... To be more specific I had to use "find":


This annoys me, I want the search to be specific, unless I add wildcards like "?" or "*" then I want what I type to be what it searches for, and if they have to put dumbed down searches in there, make it obvious that what you're getting is not an exact match.

The reason?... Imagine you have 300,000 files and you select 2,49 of then based on an exact filename search, and you give it a cursory glance, assume it to be correct, select all and delete?!?!?!

Yes, you end up deleting a load of stuff you didn't intend.

And I know, I know, I assumed what it was doing, and I know assumption is the mother of all fuck up, but still....

Even more annoying however, whilst setting up this example on windows, I did find something minor to moan about:


You can't create a folder which starts with a period in Explorer...


But you can with DOS/Command Prompt!