Static Ip on Windows PE 2

'********************************************************************
'* File: StaticIp.vbs
'* Author: CodeMan
'* dicky2k5@gmail.com
'* 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

'****************************************************************************
posted @ 2007-08-13 09:18  海潮的博客  阅读(313)  评论(0编辑  收藏  举报