ʹ Netsh



 Netsh һнűʵó򣬿ûӱػԶʾ޸ĵǰеļáNetsh ṩûʹģʽָļһĽűܡNetsh ʵóҲԽýűıļ棬Ա浵


Netsh 


 Netsh ö̬ӿ (DLL) ļϵͳÿһ Netsh  DLL ṩ˳ĵĹܼһضص顣ЩͨṩһʵóЭúͼֶ֧չ netsh ܡ磬Dhcpmon.dll ṩú͹ DHCP  netsh ĺ


Ҫ netsh  Cmd.exe ʾ netsh лҪʹСûʹõȡûѰװ磬 Netsh ʾ¼ dhcpл DHCP Уû DHCPʾϢ


The following command was not found:dhcp.


й Netsh ĵϸϢ⣺

 AAAA  Netsh 

 DHCP  Netsh 

Netsh  (diag) 

ӿ IP  Netsh 

 RAS  Netsh 

·ѡ Netsh 

 WINS  NetSh 



ʹö



һп԰һġ磬·ѡУԸĵ IP  IPX ġ


Ҫʾʹõб netsh ʾ¼ƣȻ /?  help磬Ҫʾ·ѡʹõĺб netsh ʾ£ netsh>


routing /?

routing help


Ҫ뿪ǰĶִһе񣬿 netsh ʾ¼Ҫʹõ·磬Ҫ IGMP  Local Area Connection ӿڣл IGMP ģ netsh ʾ¼룺


routing ip igmp add interface "Local Area Connection" startupqueryinterval=21


 Cmd.exe ʾ Netsh 



 Cmd.exe ʾ Netsh ʱnetsh ʹ﷨ҪԶ Windows 2000 Server Щ Netsh ʹáԶӡӵն˷ Windows 2000 ServerWindows 2000  Windows XP ϵ Netsh ܴ֮ڹԲ졣


Ҫ鿴﷨뵥


netsh 


Netsh һнűʵó򣬿ûӱػԶʾ޸ĵǰеļáʹò netsh Դ Netsh.exe ʾ netsh>


﷨



netsh [-a AliasFile] [-c Context] [-r RemoteComputer] [{NetshCommand|-f ScriptFile}]






	-a

	 AliasFile 󷵻ص netsh ʾ

	AliasFile

	ָһ netsh ıļơ

	-c

	ĵָ netsh ġ

	Context 

	ָ netsh ġ±г˿õ netsh ġ
	

Ĳ˵
˵


AAAA
ʾ Internet ֤ (IAS) Լ·ɺԶ̷ʷʹõ֤Ȩʺ (AAAA) ݿá


DHCP
 DHCP ṩڿ̨ĹͬĹܡ


Diag
ϵͳԼѽ


Interface
 TCP/IP Э飨ַĬءDNS  WINS ʾúͳϢ


RAS
Զ̷ʷ


Routing
·ѡ


WINS
 WINS 


	

	-r

	Զ̼

	RemoteComputer

	ָҪõԶ̼

	NetshCommand

	ָҪе netsh 

	-f

	нű˳ Netsh.exe

	ScriptFile

	ָҪеĽű

	/?ʾʾ



ע


	ʹ -r
	
һǰָ -r netsh Զִ̼иȻ󷵻ص Cmd.exe ʾûһָ -rԶģʽ netshù Netsh ʾʹ set machine ʹ -r ʱֻΪ netsh ĵǰʵĿ˳Ȼ netsh ĿΪؼԶ̼ netsh ָ洢 WINS еļһ UNC һ DNS  Internet  IP ַ
	
 


 Netsh.exe ʾ Netsh



 Netsh жʹ׼ûԴ Netsh.exe ʾ netsh>ЩҪԶ Windows 2000 Server Щ Netsh ʹáԶӡӵն˷ Windows 2000 ServerWindows 2000  Windows XP ϵ Netsh ܴ֮ڹԲ졣


Ҫ鿴﷨뵥

.. 


תһġ


﷨



.. 






	/?ʾʾ
 


abort 


ѻģʽ½еиġAbort ģʽвá


﷨



abort






	/?ʾʾ
 


add helper 


װ netsh еİ DLL


﷨



add helper DLLName 






	DLLName
	衣ָҪװİ DLL ơ

	/?ʾʾ
 


alias 


ûַɵınetsh ûַַͬȴʹûв alias ʾпõı


﷨



alias [AliasName] [string1 [string2 ...]]






	alias [AliasName]

	ʾָı

	alias [AliasName][string1[string2 ...]]

	 AliasName Ϊַָ

	/?ʾʾ






 netsh ʾű netsh Shaddr  ShpȻ˳ Interface IP ĵ Netsh ʾ

 alias shaddr show interface ip addr
 alias shp show helpers
 interface ip

 Netsh ʾ¼ shaddrNetsh.exe ὫΪ show interface ip addr Netsh ʾ¼ shp Netsh.exe ὫΪ show helpers 


bye 


˳ Netsh.exe


﷨



bye






	/?ʾʾ
 


commit 


ѻģʽȫύ·Commit ģʽЧ


﷨



commit 






	/?ʾʾ
 


delete helper 


 netsh ɾ DLL


﷨



delete helper DLLName






	DLLName

	衣ָҪжصİ DLL ơ

	/?ʾʾ
 


dump 


һǰõĽűýű浽ļУʹøļָѸĵáʹò dump ʾ netsh á


﷨



dump [FileName]






	[?FileName}

	ָҪضļơ

	/?ʾʾ





exec 


ؽűļִе


﷨



exec ScriptFile






	ScriptFile

	衣ָҪزеĽűơ



ע


	ScriptFile һ̨̨ϡ





exit 


˳ Netsh.exe


﷨



exit 






	/?ʾʾ
 


help 


ʾ


﷨



{/?|?|help|h}






	
 


offline 


ǰģʽóѻ


﷨



offline 






	/?ʾʾ



ע


	ģʽĸĽᱣҪ commit  online ·еĸġ
	ѻģʽлģʽʱѻģʽĸĽڵǰезӳ
	ģʽĸĻڵǰезӳ






online 


ǰģʽó


﷨



online 






	/?ʾʾ



ע


	ģʽĸĻڵǰезӳ
	ѻģʽлģʽʱѻģʽĸĽڵǰезӳ





popd 


Ӷջָһġ


﷨



popd 






	/?ʾʾ



ע


	 pushd һʹʱpopd ʹûܹģµȻ󷵻صǰġ







ʾűĴӸĸĵ interface ip ģӾ̬ IP ·ɣȻ󷵻صģ

netsh>pushd
 netsh>interface ip
 netsh interface ip>set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1
 netsh interface ip>popd netsh> 


pushd 


Ƚ (FILO) ջϵĵǰġ


﷨



pushd 






	/?ʾʾ



ע


	 popd һʹʱpushd ʹûܹģµȻ󷵻صǰġ
 


quit 


˳ Netsh.exe


﷨



quit 






	/?ʾʾ
 


set file 


ʾڵƵļС


﷨



set file {open FileName|append FileName|close} 






	open FileName

	ʾڵ͵ָļС

	append FileName

	ʾڵ׷ӵָļС

	close

	ֹͣرļ

	/?ʾʾ



ע


	ʹ FileName
	
ָ FileName ǰڣ netsh Ըƴһļָ FileName ǰڣ netsh еݡ
	





ҪΪ Session.log ־ļ netsh Ƶ Session.log룺

set file open c:\session.log 


set machine 


õǰִʹò set machine ñؼ


﷨



set machine [[ComputerName=]string] 






	ComputerName

	ָҪִļơ

	ַ 

	ָԶ̼λá

	/?ʾʾ



ע


	ڶִ̨
	
ͨһűڶ̨ڽűʹ set machine ָĿ ComputerAȻиü ComputerA set machine ʹ set machine ָһ̨Ŀ ComputerBȻиü ComputerBϵ
	
 


set mode 


õǰģʽΪѻ


﷨



set mode {online|offline}






	online

	ǰģʽó

	ѻ

	ǰģʽóѻ

	/?ʾʾ
 


show 


ʾģʽϢ


﷨



show {alias|helper|mode}






	alias 

	гжı

	helper 

	гж

	mode 

	ʾǰģʽ

	/?ʾʾ
 


unalias 


ɾָı


﷨



unalias AliasName






	AliasName

	衣ָơ

	/?ʾʾ
 

XOX



