Oui, c'est pas un release - renew que j'ai besoin merci
Je veux un truc genre :
assignAdressIP1=192.168.1.1
assiignAdressNetword=255.255.255.0
assignadressGateway=192.168.1.2
assignPrimeryDNS=195.238.2.21
assigSecondaryDNS=195.238.2.22
assignAdressIP2=172.18.6.73
AssignAdressNetwork=255.255.255.240
Comme ça il met ma carte réseau avec les valeurs
Ensuite je reveux un batche pour le remettre en automatique dhcp
On peut etudier le ipconfig /? mais il y a rien dedans lol
Code:
USAGE:
ipconfig [/? | /all | /renew [adapter] | /release [adapter] |
/flushdns | /displaydns | /registerdns |
/showclassid adapter |
/setclassid adapter [classid] ]
where
adapter Connection name
(wildcard characters * and ? allowed, see examples)
Options:
/? Display this help message
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.
Apparament en programation objet on peut y faire qqch
Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard in colNetCards
strPrimaryServer = "192.168.1.100"
strSecondaryServer = "192.168.1.200"
objNetCard.SetWINSServer strPrimaryServer, strSecondaryServer
Next