Interface Posted May 28, 2007 Posted May 28, 2007 I am try to add an optin to set static ip on my winpe hta menu...For thisI use a vbs script to run netsh ,,Please tel me what I am doing wrong!!!when I run thsi vbs the error is like the following command was not find .SetIp.vbs '********************************************************************'* File: StaticIp.vbs'* Author: CodeMan'* dicky2k5@gmail.com'* Created: May 2007'* Version: 2'* Description: Seting Static IP''* Dependencies: To Use on Win Pe2'********************************************************************Option ExplicitDim strTaskValue, objShell, objFso, objWmiService, strOutPutDim strIP, strSub, strGtwSet objShell = CreateObject("WScript.Shell")Set objFso = CreateObject("Scripting.FileSystemObject")Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")'****************************************************************************'*SetIp'****************************************************************************'Sub RunSetipstrIP = 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, falseMsgbox "Whois Me-->IP--> " & strIP & " MASK--> "& strSub & " G'WAY-->"& strGtw & " "'End '****************************************************************************
zorphnog Posted May 29, 2007 Posted May 29, 2007 Your syntax is all wrong. The command you're trying to call doesn't exist. In a command prompt, type netsh. Once you're in the shell type 'help' for more help on syntax. Your command needs to be something like this:objShell.Run "%comspec% /k netsh interface ipv4 set address 'Local Area Connection' static " & strIP & " " & strSub & " " & strGtw,1, false
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