답변:
이것은 꽤 오래된 문서입니다 (2009 년 2 월) : Microsoft 스크립팅 포럼 에서 MAC 주소 를 기반으로 컴퓨터 이름을 변경하는 스크립트 . 나는 몇 년 전에 그것을 사용했습니다.
하위 변경 회사 이름 (strComputer, Seg, IP)
'==================================================== ==============================================
'이 하위는 상수 값과 입력 한 IP 주소에 따라 컴퓨터 이름을 변경합니다
'레지스트리의 ComputerName 키와 다른 키를 변경합니다.
'==================================================== ==============================================
const HKEY_LOCAL_MACHINE = & H80000002
oReg = GetObject ( "winmgmts : {impersonationLevel = impersonate}! \\"& _ 설정)
strComputer & "\ root \ default : StdRegProv")
strKeyPath = "SYSTEM \ CurrentControlSet \ Control \ 컴퓨터 이름 \ 컴퓨터 이름"
strValueName = "컴퓨터 이름"
strValue = "CompName"& seg & IP
oReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
strKeyPath = "SYSTEM \ CurrentControlSet \ Services \ Tcpip \ 매개 변수"
strValueName = "호스트 이름"
strValue = "CompName"& seg & IP
oReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
strKeyPath = "SYSTEM \ CurrentControlSet \ Services \ Tcpip \ 매개 변수"
strValueName = "NV 호스트 이름"
strValue = "CompName"& seg & IP
oReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
objFile.WriteLine "컴퓨터 이름 :"& strValue
'==================================================== ==============================================
'새 컴퓨터 이름을 로그에 씁니다
'==================================================== ==============================================
엔드 서브