Search code examples
windowspython-3.xwinapipywin32

Getting a list of named pipes on Windows using win32api?


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?


Solution

  • As noted in comment

    import os
    arr = os.listdir('\\\\.\\pipe')
    print (arr)