Default Windows named pipes - powershell-4.0

I am writing a Powershell script to find all named pipes.
I need to filter out pipe names which are expected and display the suspicious one.
I know how to get all the named pipes, but is there a place or document which mentioned which named pipes are to be there by default?

Related

Is there a list of special folders like named pipe (\\.\pipe\) on Windows

I googled for named pipe and found Windows uses folders \\.\pipe\ for named pipes. Does any one know if there is a list of such special folders? And what are the usage of those folders?
Those are not folders, but rather names in the "win32 device namespace", see Naming Files, Paths, and Namespaces for more details.
Other reserved names include the following:
From CreateFile():
\\.\PhysicalDrive<#>
\\.\<DriveLetter>:
\\.\Changer<#>
\\.\TAPE<#>
\\.\COM<#>
CONIN$
CONOUT$
From CreateMailSlot():
\\.\mailslot\<name>
From CreateNamedPipe():
\\.\pipe\<name>

In Windows, how can I restore original characters to a csv file that have been replaced with hex ASCII?

I have a csv file that contains names Like O'Brien that appear as O%27Brien or St. Something that appear as St%2ESomething. I don't have access to generate a new csv of this data, and I need the names in a correct format because I'm writing a PowerShell script to search for the names on another server.
I tried implementing something similar to the answer to this but I can't get it to work for the problem I'm experiencing.
It doesn't matter to me if the solution is in PowerShell as long as I can run it on Windows 7.
Use the Uri.UnescapeDataString method which you can call from powershell like this:
# > [Uri]::UnescapeDataString("O%27Brien")
O'Brien

How can I get a list of Anonymous pipes opened

As a follow up to the older question : How can I get a list of all open named pipes in Windows? , I am in a situation where I need to check if a process uses anonymous pipes to communicate with its children. Is there a way to do this ? I've tried pipelist and process-explorer but it looks like they display only lists of NamedPipes
#Deanna : As an answer to close this topic
Indeed procExplorer lists all anonymous objects. But it is not yet possible to view anonymous pipes specifically. Which leads me to assume that, one cannot determine with absolute certainty the un-named pipes used by a process

Is it possible to discover named pipes in Windows?

Is there any method or tool that list existing named pipes in a Windows box?
The sysinternals tool, pipelist, is designed to list the existing named pipes.
C#:
String[] listOfPipes = System.IO.Directory.GetFiles(#"\\.\pipe\");
edit: Warning!
This approach may fail and throw an exception if any existing pipe name contains characters that are illegal for use in file names. Pipe names are less restrictive than file names, so it is possible that some pipe may have a strange name and cause this exception.

Are there any invalid linux filenames?

If I wanted to create a string which is guaranteed not to represent a filename, I could put one of the following characters in it on Windows:
\ / : * ? | < >
e.g.
this-is-a-filename.png
?this-is-not.png
Is there any way to identify a string as 'not possibly a file' on Linux?
There are almost no restrictions - apart from '/' and '\0', you're allowed to use anything. However, some people think it's not a good idea to allow this much flexibility.
An empty string is the only truly invalid path name on Linux, which may work for you if you need only one invalid name. You could also use a string like "///foo", which would not be a canonical path name, although it could refer to a file ("/foo"). Another possibility would be something like "/dev/null/foo", since /dev/null has a POSIX-defined non-directory meaning. If you only need strings that could not refer to a regular file you could use "/" or ".", since those are always directories.
Technically it's not invalid but files with dash(-) at the beginning of their name will put you in a lot of troubles. It's because it has conflicts with command arguments.
I personally find that a lot of the time the problem is not Linux but the applications one is using on Linux.
Take for example Amarok. Recently I noticed that certain artists I had copied from my Windows machine where not appearing in the library. I check and confirmed that the files were there and then I noticed that certain characters in the folder names (Named for the artist) were represented with a weird-looking square rather than an actual character.
In a shell terminal the filenames look even stranger: /Music/Albums/Einst$'\374'rzende\ Neubauten is an example of how strange.
While these files were definitely there, Amarok could not see them for some reason. I was able to use some shell trickery to rename them to sane versions which I could then re-name with ASCII-only characters using Musicbrainz Picard. Unfortunately, Picard was also unable to open the files until I renamed them, hence the need for a shell script.
Overall this a a tricky area and it seems to get very thorny if you are trying to synchronise a music collection between Windows and Linux wherein certain folder or file names contain funky characters.
The safest thing to do is stick to ASCII-only filenames.

Resources