Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows compatibility #10

Open
neekey opened this issue May 4, 2016 · 5 comments
Open

windows compatibility #10

neekey opened this issue May 4, 2016 · 5 comments

Comments

@neekey
Copy link
Owner

neekey commented May 4, 2016

More windows compatibility test work should be done, refer to ps-list by @sindresorhus, I should take a look at tasklist

@neekey
Copy link
Owner Author

neekey commented May 5, 2016

Test passed on Win10/7

@thorn0
Copy link

thorn0 commented Oct 20, 2016

Did you have a look at the wintools module?

At least on my computer, it returns data much faster than your module. Seems like the command it uses

wmic process list /format:csv

is faster than

wmic process get ProcessId,CommandLine

See the relevant part of the source code.

@thorn0
Copy link

thorn0 commented Oct 20, 2016

So far, the only caveat I found is that the resulting output sometimes isn't valid CSV. E.g. if the command line contains commas, it doesn't escape them anyhow. So some heuristics are needed to parse it.

@neekey
Copy link
Owner Author

neekey commented Oct 22, 2016

@thorn0 thanks for sharing this information, will take a look!

@addisonElliott
Copy link

This is an interesting find indeed.

I did a basic test and concluded that the reason why this is faster is the /format:csv part of the code. I compared wmic process get xxx to wmic process list and they returned at about the same time.

The CSV formatting really speeded things up.

@thorn0 or @neekey If you guys want to test, try this:

wmic process get ProcessId,ParentProcessId,CommandLine /format:csv

versus

wmic process get ProcessId,ParentProcessId,CommandLine

I may submit a PR to switch to using the CSV formatting. Will need to address the commas issue in command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants