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

Make usb network a private connection on windows #35

Open
Eeems opened this issue Oct 4, 2023 · 2 comments
Open

Make usb network a private connection on windows #35

Eeems opened this issue Oct 4, 2023 · 2 comments
Labels
enhancement New feature or request rewrite

Comments

@Eeems
Copy link
Collaborator

Eeems commented Oct 4, 2023

You can use the following to only run code if it's on windows:

import os

if os.name == 'nt':

You can then use powershell to check the status of a network, and mark is as private:

Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex 13 -NetworkCategory Private

Python can run powershell in a subprocess, which is probably easiest. I've also written code in the past to use Python.NET to run powershell code within a .NET context that I could give you some pointers from, but that adds more dependencies to your code that you probably don't need.

@Jayy001
Copy link
Owner

Jayy001 commented Oct 21, 2023

I can only do a little with this as I don't use a Windows machine. Is anybody willing to do some testing for this to see how it could be automated for finding the interface index?

@Jayy001 Jayy001 added enhancement New feature or request rewrite labels Mar 17, 2024
@Eeems
Copy link
Collaborator Author

Eeems commented May 25, 2024

I would be able to test anything you write here. I guess it might be easier for me to develop and open a PR as I have windows installs I can test with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rewrite
Projects
None yet
Development

No branches or pull requests

2 participants