- @echo off
- for /f "tokens=6 delims=.: " %%i in ('ipconfig /all^|findstr /c:"IP Address"') do set name=H%%i
- 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 "" "c:\windows\explorer.exe"
复制代码
|