vAgo Posted January 25, 2005 Posted January 25, 2005 I not able to create some script for my unattended XPthis script could be insert number of ip subnet gateway etc... and others network options like dhcp serviceand it's run after application install was finishedhelp me and pardon "my english"
Dahi Posted January 25, 2005 Posted January 25, 2005 Your PC should be able to get network settings from a DHCP server without any special configuration/scripts (if your network drivers are installed correctly).You can also specify IP, subnet mask, DNS, WINS settings in the WINNT.SIF file.Read REF.CHM in \SUPPORT\Deploy.cab on your XP CD for details.
vAgo Posted January 25, 2005 Author Posted January 25, 2005 ok...but every pc in lan network have different ip addresscan i create a WINNT.SIF for each dvd?!i try to create some script....this script set-ip address-group-subnet-gateway-domainetc....plaese help!!!
vAgo Posted January 25, 2005 Author Posted January 25, 2005 i found it strComputer = "."strAnswer=msgbox ("Use 192.168.1.141 / 24?" & vbcrlf & vbcrlf & "If not, you''ll be prompted to specify", vbYesNoCancel)if strAnswer = vbYes then Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") strIPAddress = Array("192.168.1.141") strSubnetMask = Array("255.255.255.0") strGateway = Array("192.168.1.100") strGatewayMetric = Array(1) For Each objNetAdapter in colNetAdapters errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." End If Nextelseif strAnswer = vbNo then Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") strIPAddress = array(inputbox("IP Address")) '' Array("192.168.1.141") strSubnetMask = array(inputbox("Mask")) '' Array("255.255.255.0") strGateway = array(inputbox("GW")) '' Array("192.168.1.100") strGatewayMetric = Array(1) For Each objNetAdapter in colNetAdapters errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." End If Nextelse msgbox ("Operation Cancelled by User")end ifit's a visual basic script!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now