'********************************************************************
'* File: StaticIp.vbs
'* Author: CodeMan
'*
[email protected]
'* Created: May 2007
'* Version: 2
'* Description: Seting Static IP
''* Dependencies: To Use on Win Pe2
'********************************************************************
Option Explicit
Dim strTaskValue, objShell, objFso, objWmiService, strOutPut
Dim strIP, strSub, strGtw
Set objShell = CreateObject("WScript.Shell")
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
'****************************************************************************
'*SetIp
'****************************************************************************
'Sub RunSetip
strIP = inputbox ("Please enter the IP Address.","192.168.1.11","192.168.1.11")
strSub = inputbox ("Please enter the Subnet Mask.","255.255.255.0","255.255.255.0")
strGtw = inputbox ("Please enter the Gate Way.","192.168.1.1","192.168.1.1")
'Msgbox "netsh int ip addr set local static "& strIP & " "& strSub & " "& strGtw & " "
objShell.Run "%comspec% /k netsh int ip addr set local static "&strIP & " "& strSub & " "& strGtw & " ",1, false
Msgbox "Whois Me-->IP--> " & strIP & " MASK--> "& strSub & " G'WAY-->"& strGtw & " "
'End
'****************************************************************************