Python Forum
Setting DCHP in Windows 10 with Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting DCHP in Windows 10 with Python
#1
HI,

Trying to fiugre out how i can set DHCP and Static IP in Windows 10 using python 3.6.5.

Been googling without finding what im looking for,
Reply
#2
How would you do it without python?
Reply
#3
Change it manually
Reply
#4
From the command line? Then use the subprocess module to call those same programs.
Reply
#5
thanks, using subprocess to run the command direct from python as i dont want to call a separate program.

Command im using are :
import subprocess
import time

dhcp = subprocess.call('netsh int ip set address name = "Ethernet" source = dhcp', shell=True)
Unfortunatel this is command that requires admin rights, so it wont run. Can i tell it ro run with admin roghts somehow?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  A question about setting up Python JanOlvegg 1 568 Feb-20-2023, 10:21 PM
Last Post: deanhystad
  Setting up new Python kernel for JupyterLab Desktop on M1 Mac daler6 0 1,259 Jun-20-2022, 03:45 AM
Last Post: daler6
  Setting permanent user variables in Windows coder420 2 1,404 Jan-04-2022, 10:42 AM
Last Post: Larz60+
  Advice on Setting Up the Python Environment punksnotdead 1 2,370 May-15-2019, 04:29 PM
Last Post: snippsat
  Setting up Python on a Mac - Beginner BrowneyesPage1979 1 2,417 Aug-30-2018, 10:41 PM
Last Post: snippsat
  Setting up python with visual studio code. Having one issue. xringo 2 3,722 May-21-2018, 12:09 AM
Last Post: snippsat
  os.environ not setting current shell variables in Windows? brian6667 2 10,810 Apr-26-2017, 12:59 PM
Last Post: brian6667
  setting evironment of Linux using python kgkhan 2 4,748 Dec-06-2016, 02:27 PM
Last Post: kgkhan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020