- @echo off
- for /f "tokens=15" %%i in ('ipconfig /all^|find "IP Address"') do set name=%%i
- set name=H%name:~-3%
- reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /f /v ComputerName /t reg_sz /d "%name%"
- reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /f /t reg_sz /d "%name%"
- reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /f /v Hostname /t reg_sz /d "%name%"
- taskkill /im explorer.exe /f&start explorer.exe
- rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1
复制代码
不好意思,因为在CMD下测试,最后忘了把for加多个百分号了,一个百分号的for在批处理中是错误的,加多一个就可以了
[ 本帖最后由 lovelymorning 于 2008-6-20 20:24 编辑 ] |