Reputation: 65619
Is there an easy way to test whether your named pipe is working correctly? I want to make sure that the data I'm sending from my app is actually being sent. Is there a quick and easy way to get a list of all the named pipes?
Upvotes: 126
Views: 177267
Reputation: 551
I stumbled across a feature in Chrome that will list out all open named pipes by navigating to file://.//pipe//
Since I can't seem to find any reference to this and it has been very helpful to me, I thought I might share.
Upvotes: 43
Reputation: 45252
In the Windows Powershell console, type
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
get-childitem \\.\pipe\
This returns a list of objects. If you want the name only:
(get-childitem \\.\pipe\).FullName
In Powershell 7, the second example \\.\pipe\
does not work (see this known bug), so you will have to stick to the first syntax.
Upvotes: 141
Reputation: 101
The second pipe was interpreted by this web site when submitted... You need two backslashes at the beginning. So make sure to use System.IO.Directory.GetFiles(@"\\.\pipe\")
.
Note that I have seen this function call throw an 'illegal characters in path.' exception when one of the pipes on my machine had invalid characters. PipleList.exe worked ok though, so it seems like a bug in MS's .NET code.
Upvotes: 10
Reputation: 1515
At CMD
prompt:
>ver
Microsoft Windows [Version 10.0.18362.476]
>dir \\.\pipe\\
Upvotes: 31
Reputation: 269
C#:
String[] listOfPipes = System.IO.Directory.GetFiles(@"\\.\pipe\");
Upvotes: 20
Reputation: 641
Try the following instead:
String[] listOfPipes = System.IO.Directory.GetFiles(@"\\.\pipe\");
Upvotes: 57
Reputation: 47462
You can view these with Process Explorer from sysinternals. Use the "Find -> Find Handle or DLL..." option and enter the pattern "\Device\NamedPipe\". It will show you which processes have which pipes open.
Upvotes: 124