[ create a new paste ] login | about

Link: http://codepad.org/Qk4MQKLB    [ raw code | fork ]

arachneng - Plain Text, pasted on Oct 25:
@echo off
setlocal
set self=%0
set conn="로컬 영역 연결"
if x%1x==x/lx (
	if x%2x==xx (
		%self%/c "로컬 영역 연결" dorm
	) else (
		%self%/c "로컬 영역 연결" %2 %3 %4 %5 %6 %7 %8 %9
	)
) else if x%1x==x/wx (
	if x%2x==xx (
		%self%/c "무선 네트워크 연결" -
	) else (
		%self%/c "무선 네트워크 연결" %2 %3 %4 %5 %6 %7 %8 %9
	)
) else if x%1x==x/cx (
	set conn=%2
	shift
	shift
) else (
	%self%/l %1 %2 %3 %4 %5 %6 %7 %8 %9
)

rem predefined addresses
if x%1x==xdormx %self%/c %conn% 110.76.78.234 110.76.78.1 255.255.255.0
if x%1x==xhajex %self%/c %conn% 143.248.133.131 143.248.133.1 255.255.255.0

set addr=%1
set gateway=%2
set mask=%3

if x%addr%x==x-x (
	echo setting connection %conn% w/ dhcp mode...
	netsh -c "interface ip" set address name=%conn% dhcp
) else (
	echo setting connection %conn% w/ address %addr%/%mask% and gateway %gateway%...
	netsh -c "interface ip" set address name=%conn% static %addr% %mask% gateway=%gateway% gwmetric=0
)

echo on


Create a new paste based on this one


Comments: