|
要这个?
- @echo off
- set tempsys=%1
- if %1*==* SET TEMPSYS=C:\windows\system32\config\SYSTEM
- REG LOAD HKLM\TEMPSYS %tempsys%
- set regx=HKLM\TEMPSYS\ControlSet001
- echo 计算机名称 >%temp%\temp.txt
- for /f "tokens=3" %%c in ('reg query %regx%\Control\ComputerName\ComputerName ^| find /i "computername"') do echo %%c >>%temp%\temp.txt
- echo.>>%temp%\temp.txt
- echo IP地址>>%temp%\temp.txt
- for /f %%c in ('reg query %regx%\Services\Tcpip\Parameters\Interfaces') do (
- for /f "tokens=3" %%d in ('reg query %%c /v ipaddress^|find /i "ipaddress"') do if not %%d*==0.0.0.0\0\0* echo %%d>>%temp%\temp.txt
- )
- echo.>>%temp%\temp.txt
- echo 子网掩码>>%temp%\temp.txt
- for /f %%c in ('reg query %regx%\Services\Tcpip\Parameters\Interfaces') do (
- for /f "tokens=3" %%d in ('reg query %%c /v subnetmask^|find /i "subnetmask"') do if not %%d*==0.0.0.0\0\0* echo %%d>>%temp%\temp.txt
- )
- echo.>>%temp%\temp.txt
- echo 默认网关>>%temp%\temp.txt
- for /f %%c in ('reg query %regx%\Services\Tcpip\Parameters\Interfaces') do (
- for /f "tokens=3" %%d in ('reg query %%c /v defaultgateway^|find /i "defaultgateway"') do if not %%d*==\0* echo %%d>>%temp%\temp.txt
- )
- echo DNS 服务器>>%temp%\temp.txt
- for /f %%c in ('reg query %regx%\Services\Tcpip\Parameters\Interfaces') do (
- for /f "tokens=3" %%d in ('reg query %%c /v nameserver^|find /i "nameserver"') do echo %%d>>%temp%\temp.txt
- )
- echo.>>%temp%\temp.txt
- REG UNLOAD HKLM\TEMPSYS
- cls
- type %temp%\temp.txt
- echo.
- pause
复制代码 |
|