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

Check for Admin privileges not working (Windows 10) #7

Open
jansorg opened this issue Sep 25, 2018 · 1 comment
Open

Check for Admin privileges not working (Windows 10) #7

jansorg opened this issue Sep 25, 2018 · 1 comment

Comments

@jansorg
Copy link
Contributor

jansorg commented Sep 25, 2018

I've tested this on Windows 10 Pro with a local administrator account.

This was shown after I clicked on the "Install and Launch Kite" button in the autocomplete-python setup screen:
screenshot_20180925_173228

Let me know if you need more data to debug this.

@abe33
Copy link
Contributor

abe33 commented Sep 26, 2018

Yes, of course, what is the result of running net session in a bash console?

Because that's how we test admin rights:

isAdmin() {
    try {
      // Note that this method can still fail if the server has not been started
      // but it has the merit of being simple and reliable
      // see https://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights
      // for details
      child_process.execSync('net session');
      return true;
    } catch (e) {
      return false;
}

And the issue here is that it seems all the alternative solutions are way more complex and have way more reasons to fail in the long run than this one. Not being a windows user since more than a decade I'm not really sure what's the best solution is in that case.

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

2 participants