3

You could get your users to install the pipelist utility, and then process the output of:

subprocess.check_output("pipelist", universal_newlines=True)

Using C#, one can also do something like this:

String[] listOfPipes = System.IO.Directory.GetFiles(@"\\.\pipe\");

Is there a way to replicate this C# solution using pywin32/win32api?

Alex K.
  • 165,803
  • 30
  • 257
  • 277
bzm3r
  • 2,906
  • 5
  • 28
  • 61

1 Answers1

5

As noted in comment

import os
arr = os.listdir('\\\\.\\pipe')
print (arr)
Barmak Shemirani
  • 29,481
  • 6
  • 36
  • 72
  • "\Device\NamedPipe" is a filesystem, implemented by the filesystem driver "\FileSystem\Npfs". It's not a complete filesystem, though. It doesn't implement all system calls that are expected of a filesystem. But it does implement `NtQueryDirectoryFile`, so it can be used with WinAPI `FindFirstFile`, etc. – Eryk Sun Jan 23 '18 at 01:40